BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jomaa
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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.

 

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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.

 

--
Paige Miller
Jomaa
Calcite | Level 5
Thanks so much..your code above gave me what I want. Actually I'm comparing old vs current transfer, I have the list of domains in a macro variable, I need to associate it with key variables.
Astounding
PROC Star

%let newvar = %sysfunc(putc(&oldvar, $dom));

 

 

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1034 views
  • 0 likes
  • 3 in conversation