6 %let comp_keys = Game_SK Inning Top_Bot AB_Number ;
7 %let data_vars = Batter_ID Is_A_Hit Result ;
8 %let data_list = %sysfunc (tranwrd (&data_vars, %str( ), %str(,))) ;
10 data Join_Runs_AtBats_RID (drop = _: Runs) ;
12 dcl hash h (multidata:
"Y", ordered:
"A") ;
13 do _k = 1 to countw (
"&comp_keys") ;
14 h.defineKey (scan (
"&comp_keys", _k)) ;
16 h.defineData (
"RID") ;
18 do RID = 1 by 1 until (LR) ;
19 set dw.AtBats (keep=&comp_keys Runs where=(Runs)) end = LR ;
24 call missing (&data_list, _count) ;
25 do while (h.do_over() = 0) ;
26 _count = sum (_count, 1) ;
27 set dw.Runs point = RID ;
30 if not _count then output ;