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 2001, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 11 Jul 2001 09:06:46 EDT
Reply-To:   nnair@acf.dhhs.gov
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Neal K Nair <nnair@ACF.DHHS.GOV>
Subject:   Selection of cases within a procedure
Content-type:   text/plain; charset=us-ascii

Dear colleagues:

This is probably impossible, but I thought I would raise my question in this ingenious forum. I have to run several Proc Print procedures on a data set that contains over 96,000 observations and over 30 variables. For each Proc Print, I select the variables I want to print (using KEEP=) and state a condition for selection using the WHERE clause. For a couple of the Proc Print procedures, however, I want to select the first 2000 observations from the data set, primarily to limit the printing to a manageable number of cases. I read somewhere in the manual that the OBS= and the WHERE clause do not go together. Is there a way to accomplish this? Below is sample of my program (part only).

PROC PRINT DATA=ADLT1 (KEEP=AGE SEX EDUCN) NOOBS N WIDTH=MIN; WHERE AGE LE 18 AND SEX ='F'; VAR AGE SEX EDUCN; I want to do the printing only on the first 2000 observations. I tried _N_ LE 2000 as part of the WHERE clause, but, as you know, that produced an error message. I found out that OBS= and the KEEP= statements also do not go together. I am trying to avoid creating another data set with the first 2000 observations just for these couple of procedures. Is there a way, or is it a wishful thinking on my part? Thanks in advance for any helpful suggestions.

Neal


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