| Date: | Thu, 15 Sep 2011 20:37:05 +0000 |
| Reply-To: | toby dunn <tobydunn@HOTMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | toby dunn <tobydunn@HOTMAIL.COM> |
| Subject: | Re: SAS 9.3 notes |
|
| In-Reply-To: | <9F0A90FE1B47E74DB4DF72EC940E33AC18B5C45F@EMBX-CHAM4.cdc.gov> |
| Content-Type: | text/plain; charset="Windows-1252" |
Ron...
Not so fast... I see it as a half solution to the problem. Ussually when you want to know the number of obs in a data set it is a decision point in a macro.
The &SysNobs is only valid if it is the last data set sas used. What we really need imho.. is a function that retrieves it for us possibly with a few options
to specify logically deleted obs or not.
Toby Dunn
If you get thrown from a horse, you have to get up and get back on, unless you landed on a cactus; then you have to roll around and scream in pain.
“Any idiot can face a crisis—it’s day to day living that wears you out”
~ Anton Chekhov
> Date: Thu, 15 Sep 2011 19:33:49 +0000
> From: rjf2@CDC.GOV
> Subject: Re: SAS 9.3 notes
> To: SAS-L@LISTSERV.UGA.EDU
>
> Ah, So! This is impressive:
> a new System macro variable for Nobs of last-read data set:
>
> proc print data = sashelp.class;
> run;
> %put note: SysLast = &SysLast.;
> %put note: SysNobs = &SysNobs.;
>
> DATA Work.Females;
> do until(EndoFile);
> set sashelp.class
> (where = (Sex eq 'F'))
> end = EndoFile;
> output;
> end;
> stop;
>
> run;
> %put note: SysLast = &SysLast.;
> %put note: SysNobs = &SysNobs.;
>
> log:
>
> 3 %put note: SysLast = &SysLast.;
> note: SysLast = _NULL_
> 4 %put note: SysNobs = &SysNobs.;
> note: SysNobs = 19
>
> 16 %put note: SysLast = &SysLast.;
> note: SysLast = WORK.FEMALES
> 17 %put note: SysNobs = &SysNobs.;
> note: SysNobs = 9
>
> Ron Fehd waving aloha to call symputx(Nobs
|