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));
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.