LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 1999, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 16 Nov 1999 11:00:53 -0500
Reply-To:     Jacques Thibault <JacquesT@IPRONLINE.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jacques Thibault <JacquesT@IPRONLINE.COM>
Subject:      Number of obs in dataset
Content-Type: text/plain; charset="iso-8859-1"

Hi SAS-Ls,

I have this problem that when I wanna count the number of observations in a dataset and the dataset is empty, instead of having zero (0), I have one (1). Then I red that with NOBS= , for certain SAS views, the SAS system cannot determine the number of observations. In these cases, the SAS system sets the value of the NOBS= variable to the largest positive integer value available on the host system (which means 1...) <Rf.SAS Language p.485>.

This is my "simple" code:

... 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...


Back to: Top of message | Previous page | Main SAS-L page