Hi, Is there any way to create a hash table from a dataset, where the dataset name is provided dynamically during the data step? I am trying to create a macro variable to store a dataset name, and then use that name to create a hash table. However, it fails because the hash definition is compiled before runtime while the macro variable values are not assigned until runtime. Is there any way to fix the timing? This is what I am trying to do. Thanks for any advice: DATA scratch.taq2; format date yymmddn8. txtdate $8. symbol $10. time TIME8.; set taq1; declare hash wcthash; if ('10:00't le acttims < '15:30't) then do; *need date as text to use as title of dataset; txtdate=PUT(actdats, yymmddn8.); call symput('yymmdd',txtdate); call symput('symb',symbol); date= actdats; time= INTNX('minutes',acttims,-15); price =.; %put 'date is ' &yymmdd; %put 'Symbol is ' &symb; wcthash = _new_ hash(dataset: "wtaq.WCT_&yymmdd (where=(symbol='&symb'))", multidata:'yes'); wcthash.DefineKey("date","time"); wcthash.DefineData("date","time","price"); wcthash.DefineDone(); do while (time < acttims); rc=wcthash.find(); if rc=0 then output; if rc=0 then time = acttims; else time = INTNX('second',time,1); end; rc = wcthash.delete(); end; RUN;
... View more