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 (March 2005, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 29 Mar 2005 11:32:56 -0500
Reply-To:     Venita DePuy <depuy001@NOTES.DUKE.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Venita DePuy <depuy001@NOTES.DUKE.EDU>
Subject:      Re: Keep First and Last Obs in a Macro
Comments: To: Lori Lesnick <lorilesnick@FINANCIAL.WELLSFARGO.COM>
In-Reply-To:  <200503291630.j2TGUpfp011571@listserv.cc.uga.edu>
Content-Type: text/plain; charset="US-ASCII"

How about:

Data file2; set file1; by sortvar; if first.sortvar or last.sortvar;

(untested) Venita

Lori Lesnick <lorilesnick@FINANCIAL.WELLSFARGO.COM> Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> 03/29/2005 11:30 AM Please respond to Lori Lesnick <lorilesnick@FINANCIAL.WELLSFARGO.COM>

To SAS-L@LISTSERV.UGA.EDU cc

Subject Keep First and Last Obs in a Macro

Hi all,

I have a dataset with n = 33000+ observations. I need a way to retain the First value of a specific variable and the last value of the same variable into a macro that I can reference later in my program.

Any help will be appreciated! Thanks, Lori


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