Can someone please explain why CALL SYMPUTX('numobs', dsnobs, 'g') in line 60 of the following code works? It seems to me that, since the (NOBS=DSNOBS) SET statement option in line 62 comes after the STOP statement, it will never even be executed. So how is the macro variable NUMOBS ever set to 144? 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 * Program11.2.9.sas;
57 * Using the NOBS= option on the SET statement;
58 %macro numobs(dsn=);
59 data _null_;
60 call symputx('numobs', dsnobs, 'g');
61 stop;
62 set &dsn nobs=dsnobs;
63 run;
64 %mend numobs;
65 %numobs(dsn=sashelp.air)
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.02 seconds
66 %put The number of observations in SASHELP.AIR is &numobs;
The number of observations in SASHELP.AIR is 144
67
68 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
80
... View more