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 (August 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 5 Aug 2006 16:43:52 +0800
Reply-To:   Scott Bass <sas_l_739.at.yahoo.dot.com.dot.au@PESTO.CC.UGA.EDU>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Scott Bass <sas_l_739.at.yahoo.dot.com.dot.au@PESTO.CC.UGA.EDU>
Subject:   Re: extracting last two digits from a varying length variable
Comments:   To: sas-l@uga.edu

Let the SAS informat do the work, then use either the year function or format:

data _null_; length date 8; input date ddmmyy.; year=year(date); put (date date date) (=date7. =year2. =year4.) year=; cards; 10698 220599 270800 ; run;

date=01JUN98 date=98 date=1998 year=1998 date=22MAY99 date=99 date=1999 year=1999 date=27AUG00 date=00 date=2000 year=2000

HTH, Scott

"Hala" <hala.maktabi@gmail.com> wrote in message news:1154551928.485504.27190@b28g2000cwb.googlegroups.com... > hi all, > > given the following list of dates ddmmyy:: > > 10698 > 220599 > 270800 > .. > > and given that the length varies between 5 and 6 depending on whether > the day is between 1and 9 or not, > How can I extract the last two digits which represent the year? > > Thanks alot :) > > Hala >


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