In the following minimal example of declaring and using a hash object inside a data step, my understanding is that: You have to include both " if 0 then set A; " and " call missing(k); " , if you don't want SAS to complain with "ERROR: Undeclared key symbol for hash object at line 31 column 7." Can someone please confirm my understanding? Or am I confusing two different concepts? Thanks in advance. @PeterClemmensen Would highly appreciate your input since this post was a great help! SAS Version: SAS Enterprise Guide 8.3 Update 8 (64-bit) data _null_;
if 0 then set A
if _N_ = 1 then do;
declare hash h(dataset:'A');
h.defineKey('k');
call missing(k);
end; set B; if h.find()=0 then put "Key exists in A: " k=;
run;
... View more