Skip to content

Instantly share code, notes, and snippets.

@statgeek
Created August 29, 2017 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statgeek/1a8e008ecc2fe47e03c3d0022c361e78 to your computer and use it in GitHub Desktop.
Save statgeek/1a8e008ecc2fe47e03c3d0022c361e78 to your computer and use it in GitHub Desktop.
SAS - loop through macro variables and resolve
/*Demo to show how to loop through a list of macro variables*/
proc sql noprint;
select name into :name1-
from sashelp.class;
quit;
%macro demo;
%do i=1 %to 10;
%put name&i=&&name&i;
%end;
%mend;
%demo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment