Hi,
I've got a dataset that looks like this:
DATA work.kip ;
LENGTH ref $7. q1_2019 q2_2019 q3_2019 q4_2019 8. ;
INFILE CARDS TRUNCOVER ;
INPUT ref q1_2019 q2_2019 q3_2019 q4_2019 ;
CARDS ;
q1_2019 1369 3625 3679 36875
q3_2019 6369 4587 5637 8963
q2_2019 123 456 789 123
q2_2019 3568 69876 3685 7896
;
RUN ;The REF variable contains the name of the variable I would like to store in a new variable AMOUNT. I could use an IF THEN ELSE statement, but I is there a way to get the value of the variable name stored in REF?
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.