Yes you can create as many macro variables as possible.
I hear you talking about _N_ as the observation number. However, _N_ is actually the number of times the code cycled to the DATA statement.
Try this code to see what I mean:
data new_class;
set sashelp.class;
if sex eq 'M' then return;
x=_n_;
output;
run;
proc print data=new_class; run;
the original class had 19 obs, new_class has only 9.
look at the values for x they are not the same as the obs number, but the number of times the code hit the DATA statement.
Just be crateful when referring to _N_ as the observation number.
MRG
Great Help....I understand whay you mean...
This thread is about creating lists of macro variables
and this paper covers the various ways of handling such lists.
http://www.sascommunity.org/wiki/List_Processing_Basics_Creating_and_Using_Lists_of_Macro_Variables
Ron Fehd List Processing maven
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.