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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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