As featured in: Data Management Solutions Using SAS Hash Table Operations: A Business Intelligence Case Study , and built from this github repository.
Chapter 6 Left Join via Hash Table.sas
1 /* "Chapter 6 Left Join via Hash Table.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 Triples_leftjoin_Hash (drop = Count) ;
7  if _n_ = 1 then do ;
8  dcl hash triple (
9  multidata:"Y"
10  , dataset:'Dw.AtBats(rename=(Batter_ID=Player_ID)
11  where=(Result="Triple"))'
12  ) ;
13  triple.defineKey ("Player_ID") ;
14  triple.defineData ("Distance", "Direction") ;
15  triple.defineDone () ;
16  if 0 then set Dw.AtBats (keep=Distance Direction) ;
17  end ;
18  set Bizarro.Player_candidates ;
19  where Team_SK in (193) ;
20  call missing (Distance, Direction) ;
21  do while (triple.do_over() = 0) ;
22  Count = sum (Count, 1) ;
23  output ;
24  end ;
25  if not Count then output ;
26 run ;