Thanks for the responses. To clarify, I have a mother dataset named PSE and would like to extract/filter records from it using a field labelled as _NAME_. The macro script is also expected to produce output files (_XXXX). I've updated the script below to put comments. It seem to run successfully in SAS Base/EG, but not here in Studio. Thanks again for your time and patience. ====================================== %macro a(STOCK); data _&stock; /*NEW DATASET CREATED*/ set PSE; /*MOTHER DATASET*/ where _NAME_="&stock"; /*FILTER APPLIED*/ run; %mend a; %a(PSE); %a(2GO); %a(EEI);
... View more