|
Uhm, if DSNAME has zero observations, then the data step stops when the SET
statement executes, and the CALL SYMPUT never executes. In that case, you
probably get a value of 1 from some previous call. Reverse the SET and CALL
statements. It is curious, but the nobs= option applies even if the
statement never executes. To be cute, I sometimes code this as
DATA _NULL_;
CALL SYMPUT('NOBS',NOBS);
STOP;
SET DSNAME NOBS=NOBS;
RUN;
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM or http://www.aartwolf.com/twb.html
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
> ----------
> From: Jacques Thibault[SMTP:JacquesT@IPRONLINE.COM]
> Reply To: Jacques Thibault
> Sent: Tuesday, November 16, 1999 8:00 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Number of obs in dataset
>
<SNIP>
> ...
> data _null_;
> set dsname nobs=n;
> call symput('nbobs',n);
> stop;
> run;
>
> I know this looks pretty simple, and when I test only this (presuming
> dsname
> has 0 obs.), it works. But when including the same lines in my macro, it
> doesn't work anymore. Is anyone got this problem before? Is there any
> other way to get the number of obs. (like in SQL...)?...
>
> Thanks for helping...
>
|