Is it possible to replace this statement within PROC SQL:
case when variable in ('1', '2', '3', '4') then ....
with a macro of the form
case when variable in (%macroname(4)) then ...
So the macro would populate the set with the positive integers (in character form) 1 through 4 (or any positive number in place of 4).
Thanks, and sorry if this has been asked before.
While it is very possible in any case, it is easier if you are willing to:
Here is one possible approach using the simplifying assumptions above:
%macro macroname (limit);
%local i;
%do i=1 %to &limit;
"&i"
%end;
%mend macroname;
While it is very possible in any case, it is easier if you are willing to:
Here is one possible approach using the simplifying assumptions above:
%macro macroname (limit);
%local i;
%do i=1 %to &limit;
"&i"
%end;
%mend macroname;
Awesome, Thanks!
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.