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 (November 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 4 Nov 2008 10:45:30 -0500
Reply-To:     SAS_learner <proccontents@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         SAS_learner <proccontents@GMAIL.COM>
Subject:      How Can Reslove a macro in If statement ??
Content-Type: text/plain; charset=ISO-8859-1

Hello _all_,

I am doing something like for getting the dates into ISO 8601 format, but somehow date is not getting resolved after IF statement I am not sure If I need to make date as global to get it resolved ??

If you think of a better way to write this macro please let me know

Data test ; set test ; %let date = %str(Mehbegdf);

If &date. Not In ('nd' 'un' '' 'na' ) Then Do;

If Length(&date.) = 9 Then

Mhstdtc=Cats(Substr(&date.,6,4),'-',Put(Substr(&date.,3,3),$Monthf.),'-',Substr(&date.,1,2));

Else If Length(&date.) = 7 Then Mhstdtc=Cats(Substr(&date.,4,4),'-',Put(Substr(&date.,1,3),$Monthf.)); Else Mhstdtc = &date.;

Run;

TIA SL


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