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 ;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 993 views
  • 1 like
  • 2 in conversation