Hello
I have an external input data set with varaible "YYMM" that includes in this example 4 rows.
The target is to create 4 parameters called: m1,m2,m3,m4.
parameter &m1 will recieve value of varaible "YYMM" in row 1.
parameter &m2 will recieve value of varaible "YYMM" in row 2.
parameter &m3 will recieve value of varaible "YYMM" in row 3.
parameter &m4 will recieve value of varaible "YYMM" in row 4.
I am trying to it but I don't receive the requested result.
Please find the code.
thanks
Ron
DATA Raw_tbl;
INPUT YYMM;
CARDS;
1807
1806
1712
1707
;
RUN;
Data tbl2;
SET Raw_tbl;
VAR_NAME='m'||strip(_N_);
call symputx('VAR_NAME',VAR_NAME);
Run;
%put &m1;
%put &m2;
%put &m3;
%put &m4;
Just to be clear, what you are trying to create are macro variables, not parameters. Change your data step to
Data tbl2;
SET Raw_tbl;
VAR_NAME='m'||strip(_N_);
call symputx(VAR_NAME,YYMM);
Run;
Just to be clear, what you are trying to create are macro variables, not parameters. Change your data step to
Data tbl2;
SET Raw_tbl;
VAR_NAME='m'||strip(_N_);
call symputx(VAR_NAME,YYMM);
Run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.