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 (December 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 6 Dec 2004 11:52:42 -0500
Reply-To:     Bob_Abelson@HGSI.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Bob Abelson <Bob_Abelson@HGSI.COM>
Subject:      Re: get the last value of a variable form a dataset
Content-Type: text/plain; charset="us-ascii"

It seems to me you're working too hard here. Try PROC SQL:

proc sql; create table date as select *, max(DATETIME) as date from pcsglbd; quit;

Bob Abelson HGSI 240 314 4400 x1374 bob_abelson@hgsi.com

"Coffee falls into the stomach ... ideas begin to move, things remembered arrive at full gallop ... the shafts of wit start up like sharp-shooters, similies arise, the paper is covered with ink ..." -- Honore de Balzac

m k <odshtml@YAHOO.COM> Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> 12/06/2004 11:30 AM Please respond to m k

To: SAS-L@LISTSERV.UGA.EDU cc: Subject: get the last value of a variable form a dataset

Hi Iam trying to get the last value of the datetime variable from the dataset Iam using eof but it is not working it is generating a missing value.

data pcsglbd; set pcsglbd.sas7bdat; run; proc sort data=pcsglbd out=sorted; by DATETIME; run; data date; set sorted end=eof; by DATETIME; if eof then date=DATETIME; run;

__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com


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