Editor's Note: Lots of helpful and useful suggestions in this thread. Thanks to those who commented. This one leverages the GLOBAL macro information and then shows how to specifically locate the subset of variables of interest. Thanks, @paulrichmay .
Hi,
This code worked for me. Just pulls the data set where SAS stores the macro variables. Restricting to 'GLOBAL' drops the 'ATUOMATIC' vars created by SAS. Same for the if statements. Those can be dropped depending on what you've named your variables.
Hope this helps.
data macro_vars; set SASHELP.VMACRO; where scope = 'GLOBAL'; if substr(name, 1, 1) = '_' then delete; if substr(name, 1, 3) in ('SAS', 'SQL', 'SYS') then delete; drop scope offset; run;
Thanks,
Paul
... View more