Hi All,
If I have this format
proc format;
VALUE $DOM
'AE' = 'USUBJID AETERM AESTDTC'
'CE' = 'USUBJID CETERM CESTDTC'
'CM' = 'USUBJID CMTRT CMROUTE CMSTDTC'
'DD' = 'USUBJID'
'DM' = 'USUBJID'
;
run;
I have the macro variables which take the value AE, CE etc, how can I definy a new macro variable which will take 'USUBJID AETERM AESTDTC' for AE??
Thanks
For example
data _null_; call symputx("newmacrovariable",put("&origmacrovariable",$dom.)); run;
As a side issue (but it may be relatively important), you don't normally apply formats to macro variables, and it may be there's an easier way to achieve whatever it is you are doing without macro variables, or without formats. I can say more because I'd need a lot more details about what you are doing.
For example
data _null_; call symputx("newmacrovariable",put("&origmacrovariable",$dom.)); run;
As a side issue (but it may be relatively important), you don't normally apply formats to macro variables, and it may be there's an easier way to achieve whatever it is you are doing without macro variables, or without formats. I can say more because I'd need a lot more details about what you are doing.
%let newvar = %sysfunc(putc(&oldvar, $dom));
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.