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

Hello

I want that value in second column will be macro parameter name and value of first column will be the value of the macro parameter.

So:

parameter Mon1 will get value 1901

parameter Mon2 will get value 1904

parameter Mon3 will get value 1907

parameter Mon4 will get value 1908

What is the way to do it?

Data aaa;
input YYMM mon $;
CARDS;
1901 Mon1
1904 Mon2
1907 Mon3
1908 Mon4
;
Run;
1 ACCEPTED SOLUTION
2 REPLIES 2
Ronein
Onyx | Level 15

 

Data aaa;
input YYMM mon $;
CARDS;
1901 Mon1
1904 Mon2
1907 Mon3
1908 Mon4
;
Run;

data _null_;
set aaa;
call symput(mon,YYMM);
run;
%put &Mon1 ;
%put &Mon2 ;
%put &Mon3 ;
%put &Mon4 ;
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 934 views
  • 1 like
  • 2 in conversation