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));
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.