I the following code I am trying to create a dynamic variable name and use it later in the code, but it isn't fully resolving. please see the last few lines. I would like the put statement macro variable &&mem&i.._rcols to output the same info that is in &xx. I have also tried a data _null_ with a call symput to create the varialbe. %macro a; Data _null_; call symput("mem1","ae"); call symput("mem1vartotal","4"); call symput("mem2","cm"); call symput("mem2vartotal","3"); run; %do i = 1 %to 2; %let x = 0; %do v = 1 %to &&mem&i.vartotal; %let x = %eval(&x + 1); %end; %let &&mem&i.._rcols = %str(); %let xx=%str(); %do k=1 %to &x; %let xx = %str(&xx, _&k); %end; %let &&mem&i.._rcols = %str(&xx); %put &&mem&i &&mem&i.._rcols &xx ; %end; %mend a; %a;
... View more