Date: Wed, 30 Jun 1999 15:37:37 -0400
Reply-To: Tim Vorce <timv@TRILLIUMTEAM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: timv@TRILLIUMTEAM.COM
Subject: Re: Q (Not SQL): counting # obs for macro variables for row values
In-Reply-To: <F5639E63DD99D211888F00C00D008A4C0C4F73@PRIMARY>
Content-Type: text/plain; charset="iso-8859-1"
Slick yes, but maybe not right. The correct attribute to go after is nlobs
rather than nobs. The difference is observations marked for deletion. So
if you have just deleted observations, you get the wrong count.
Tim Vorce (248) 586-1999
tvorce@trilliumteam.com
Trillium Teamologies
SAS. It's not just an attitude
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Erik013@AOL.COM
Sent: Wednesday, June 30, 1999 1:33 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Q (Not SQL): counting # obs for macro variables for row
values
An ever slicker way to create a macro varaible containing the number of
Observations in a SAS dataset is:
%let dsid=%sysfunc(open(work.temp));
%let numobs=%sysfunc(attrn(&dsid,nobs));
%let rc=%sysfunc(close(&dsid));
%put The dataset contains &numobs observations;
I have been told by SAS Institute Tech Support that this is more efficient
than SQL.
Erik S. Larsen
Independent Consultant
12090 Chancery Station Circle
Reston, VA 20190
A SAS Institute Quality Partner
(703) 568-3083
Larsen770@aol.com