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 (July 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 23 Jul 2003 17:23:14 -0400
Reply-To:     "Cacialli, Doug" <Doug_Cacialli@URMC.ROCHESTER.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Cacialli, Doug" <Doug_Cacialli@URMC.ROCHESTER.EDU>
Subject:      Re: simple way to derive dataset record count?
Content-Type: text/plain

I'm not sure this is any more or less efficient, but I'd probably use PROC SQL:

proc sql noprint; select count(*) into :COUNT from /* your data set */; quit;

Doug out.

-----Original Message----- From: Patrick F. O'Neill [mailto:Patrick.F.O'Neill@KP.ORG] Sent: Wednesday, July 23, 2003 5:04 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: simple way to derive dataset record count?

Mike,

The standard answer for this I've seen posted here goes something like this:

DATA _NULL_; CALL SYMPUT('COUNT', (LEFT(PUT(NOBS,BEST.)))); STOP; SET your_dataset NOBS=NOBS; RUN;

Then use &COUNT in your next data step. Look for some discussion in the archives about why this doesn't work for views.

Yours,

Pat

Ixnay <mscgloss@yahoo.c To: SAS-L@LISTSERV.UGA.EDU om> cc: Sent by: "SAS(r) Subject: simple way to derive dataset record count? Discussion" <SAS-L@LISTSERV.U GA.EDU>

07/23/2003 01:49 PM Please respond to Ixnay

Hello All,

Is there a simple way to derive a usable record-count from a SAS data set? When I say usable I mean a number I can use in another dataset.

Thank you,

Mike


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