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
|