I need to run the same macro CT 50 times changing just one of the several parameters. A, B, C...... are 50 variables that need to be replaced in the call macro.
%CT(param1=data, param2=inv, param3=A);
%CT(param1=data, param2=inv, param3=B);
%CT(param1=data, param2=inv, param3=C);
.....
I like Barry's 1st answer and below is how you would do for his second suggestion.
get the list of variables that needs to be passed to the macro and send them all to a macro variable separating them by a special character, say LIST for example:
the macro variable LIST would be like this A*B*C*D*............*Z
now loop it through all the parameters
%do i=1 %to 50;
%let param=%scan(&list,&i,'*');
%CT(param1=data, param2=inv, param3=¶m);
%end;
hope this helps.
Copy and paste works well
or consider using a macro do / while loop
I like Barry's 1st answer and below is how you would do for his second suggestion.
get the list of variables that needs to be passed to the macro and send them all to a macro variable separating them by a special character, say LIST for example:
the macro variable LIST would be like this A*B*C*D*............*Z
now loop it through all the parameters
%do i=1 %to 50;
%let param=%scan(&list,&i,'*');
%CT(param1=data, param2=inv, param3=¶m);
%end;
hope this helps.
You can have you parameters stored in a SAS table, and call the macro by using call execute instead.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.