|
On Wed, 13 Feb 2002 12:03:09 -0500, Carriere, Ron
<rcarriere@MEDNET.UCLA.EDU> wrote:
>The NOBS option of the SET statement returns the number of records in a
>dataset after reading the first record.
>
>7 DATA _NULL_;
>8 SET ONE(OBS=1) NOBS=RECS;
>9 PUT 'RECORDS = ' RECS;
>10
>11
>12
>
>RECORDS = 109
>NOTE: There were 1 observations read from the data set WORK.ONE.
>NOTE: The DATA statement used 0.00 CPU seconds and 23291K.
>
>
>Ron Carriere
>UCLA Medical Center
in the simplest case: yes, but...
Not, if you have a view, not if you have deleted obs in the dataset.
Deleted obs you might get, if your dataset is manipulated by FSP or an AF
application.
In that cases you should use other functions. I've deleted one obs in
SASUSER.CLASS. Note the following log:
41 data test;
42 rc=open("sasuser.class");
43 lobs=attrn(rc,"nlobs");
44 obs=attrn(rc,"nobs");
45 put obs= lobs=;
46 run;
obs=19 lobs=18
You see, you get 19 obs, but you can use only 18!
|