I have a macro(SVCDATE1) that has the following value
'2002-11-01'
I need to make another macro using this value and the new macro(RSVCDATE1)needs to be in this format
'200211'
Any suggestions?
Thanks!
QueryMan
when I remember your previous requests correctly, you have the single quotes actually on that variable's content. Don't have a manual around here, so don't know if there is a format to map this in a one liner - therefore less clever:
Code:
%let SVCDATE1='2002-11-01';
data _null_;
y = substr ("&SVCDATE1.", 2, 4);
m = substr ("&SVCDATE1.", 7, 2);
call symput ("RSVCDATE1", trim(y) || m);
run;
%put &RSVCDATE1.;
Please note that this will work in SAS 8 and above - macro variable names get too long otherwise (>8 chars).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.