I have a series of macro variables named &x_(year) that I need to perform some year-specific calculations. Is there a way to combine the do loop variable with the &x_ stem to make sure everything matches up properly, or do I need to separate everything out into different steps?
Not sure what your question is but does using && help?
%macro test;
%do year=2010 %to 2011 ;
%put year=&year x_&year=&&x_&year;
%end;
%mend test ;
%let x_2010=Value for 2010;
%let x_2011=Value for 2011;
%test;
year=2010 x_2010=Value for 2010
year=2011 x_2011=Value for 2011
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.