BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SOORISAS
Calcite | Level 5

Yes you can create as many macro variables as possible.

mrgibson
Calcite | Level 5

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

robertrao
Quartz | Level 8

Great Help....I understand whay you mean...

Ron_MacroMaven
Lapis Lazuli | Level 10

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 18 replies
  • 4261 views
  • 6 likes
  • 8 in conversation