Date: Mon, 11 Aug 2003 11:32:33 -0400
Reply-To: Michael Raithel <RAITHEM@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Michael Raithel <RAITHEM@WESTAT.COM>
Subject: Re: Proc Contents gives OBSERVATIONS: .
Krishna Dandamudi posted the following in this interesting thread:
> SAS gave us VTABLE in SASHELP library. With one select
> statement you can get the value for the number of
> observations the data set has.
> Here is the code which may help.
> proc sql;
> select nobs
> from sashelp.vtable
> where libname='WORK'
> and memname='MYDATA';
Krishna, at the risk of appearing to join the ranks of the few SAS-L
nitpickers (you know who you are) or the scant SAS-L sharpshooters (and, you
know who you are, too), I would suggest making the following change to the
"95% there" code snippet, above:
select nobs - DELOBS INTO :NUMBROBS
In the code snippet, above, I have added a bit to the SELECT statement.
What I really wanted to highlight was providing the true number of
observations, which would be "NOBS - DELOBS", to account for marked for
deletion observations--as discussed ad infinitum here on the 'L. I also
threw in saving the result as a SAS Macro variable because it is so
utilitarian to have that value saved in an easy
Krishna, hopefully you are not clucking your tongue at the code above,
thinking "Sheesh, I _KNEW_ that, what a nitpicker!" or "C'mon already, that
is obvious, what a sharpshooter"!
Best of luck to you in your own use of the most helpful SAS Help data views!
I hope that this suggestion proves helpful now, and in the future!
Of course, all of these opinions and insights are my own, and do not reflect
those of my organization or my associates. All SAS code and/or methodologies
specified in this posting are for illustrative purposes only and no warranty
is stated or implied as to their accuracy or applicability. People deciding
to use information in this posting do so at their own risk.
Michael A. Raithel
"The man who wrote the book on performance"
Author: Tuning SAS Applications in the MVS Environment
That's the way things come clear. All of a sudden. And
then you realize how obvious they've been all
along. - Madeleine L'Engle