data small; input id name $5. phone x; datalines; 125 Bob 5550001 1 325 Sue 9991000 3 100 Fran 5552000 4 295 Sam 9991100 2 285 Jeff 5551100 8 275 Ed 9999999 2 300 Ron 5551111 4 ; data large; do id=100 to 300 by 5; output; end; run; data match; length id 8; length name $5; length phone 8; if _N_ = 1 then do; /* Load SMALL data set into the hash object */ declare hash h(dataset: "work.small", hashexp: 6); /* Define SMALL data set variable id as key, name and phone as data */ h.defineKey('id'); h.defineData('name','phone'); h.defineDone(); call missing(id, name, phone); end; /* Use the SET statement to iterate over the LARGE data set */ set large; rc = h.find(); if (rc = 0) then output; run; proc print; run;