As featured in: Data Management Solutions Using SAS Hash Table Operations: A Business Intelligence Case Study , and built from this github repository.
Chapter 11 Pregrouped Unduplication.sas
1 /* "Chapter 11 Pregrouped Unduplication.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 First_scores_grouped ;
7  if _n_ = 1 then do ;
8  dcl hash h () ;
9  h.defineKey ("Runner_ID") ;
10  h.defineData ("_iorc_") ;
11  h.defineDone () ;
12  dcl hiter ih ("h") ;
13  end ;
14  do until (last.Game_SK) ;
15  set dw.Runs (keep = Game_SK Inning Top_Bot Runner_ID) ;
16  by Game_SK ;
17  if h.check() = 0 then continue ;
18  output ;
19  h.add() ;
20  end ;
21  h.clear() ;
22 run ;