As featured in: Data Management Solutions Using SAS Hash Table Operations: A Business Intelligence Case Study , and built from this github repository.
Chapter 5 GeneratePitchDistribution.sas
1 /* "Chapter 5 GeneratePitchDistribution.sas" from the SAS Press book
2  Data Management Solutions Using SAS Hash Table Operations:
3  A Business Intelligence Case Study
4 */
5 
6 data bizarro.pitch_distribution;
7  Pitch_Distribution_SK = _n_;
8  input Result $16. AB_Done Is_An_AB Is_An_Out Is_A_Hit Is_An_OnBase Bases Runners_Advance_Factor From To;
9  label Pitch_Distribution_SK = "Pitch Distribution Surrogate Key"
10  Result = "Result of the Pitch"
11  AB_Done = "Final Pitch of the AB"
12  Is_An_AB = "Counts as an AB"
13  Is_An_Out = "Is an Out"
14  Is_A_Hit = "Is a Hit"
15  Is_An_OnBase = "Counts as an On Base"
16  Bases = "Number of Bases for the Hit"
17  Runners_Advance_Factor = "Proabability of an Extra Base"
18  From = "Lower Range of Distribution"
19  to = "Upper Range of Distribution"
20  ;
21  datalines;
22 Ball 0 . . . . . . 1 33
23 Called Strike 0 . . . . . . 34 48
24 Double 1 1 0 1 1 2 .7 49 51
25 Error 1 1 0 0 0 1 .4 52 52
26 Foul 0 . . . . . . 53 68
27 Hit By Pitch 1 0 0 0 1 1 0 69 69
28 Home Run 1 1 0 1 1 4 0 70 71
29 Out 1 1 1 0 0 0 0 72 83
30 Single 1 1 0 1 1 1 .5 84 88
31 Swinging Strike 0 . . . . . . 89 99
32 Triple 1 1 0 1 1 3 0 100 100
33 run;
34 
35 data bizarro.hit_distance;
36  Hit_Distance_SK = _n_;
37  input Pitch_Distribution_FK MinDistance MaxDistance;
38  label Hit_Distance_SK = "Hit Distance Surrogate Key"
39  Pitch_Distribution_FK = "Pitch Distribution Foreign Key"
40  MinDistance = "Hit Distance Minimum"
41  MaxDistance = "Hit Distance Maximum"
42  ;
43  datalines;
44  3 200 300
45  4 50 300
46  7 390 480
47  8 3 385
48  9 10 100
49 11 310 390
50 run;