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 (February 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 4 Feb 1999 11:33:45 GMT
Reply-To:     David Booth <dkb@CIX.COMPULINK.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         David Booth <dkb@CIX.COMPULINK.CO.UK>
Organization: Compulink Information eXchange
Subject:      Re: Changing the value of last obs in a Dataset

Ignatius Esele asks: > How can I change the value of last observation in a DATASET? > > DATA XX; > SET YY; > BY IDG; > Z = 1; > IF LAST.IDG THEN Z = 2; > RUN; > I want Z=2 only for the last observation. This does not seem to work. > Thanks. > Ignatius.

Use the end= option to set a variable to 1 when the last record is read: DATA XX; SET YY end=the_end; IF the_end THEN Z = 2; else Z = 1; RUN;

Dave .


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