Dear,
I am able to call the macro variables values created by datastep(withoutmacro) where ever I can by calling "&b1,&c1,&d1,&e1".
But the macro variables created by macro step(shown below), I am not able call the macro variables. When I use "&b1,&c1,&d1,&e1" in a datastep,the values of the macrovariables are not called
Please help how can I use the macro variables created by the macro step below. Thank you very much
data one;
input NS trt01a $ ;
datalines;
45 150MG
71 300MG
15 75MG
131 TOTAL
;
%macro two(var1=,var2=,var3=,var4=,var5=,var6=,var7=);
data &var2;
set &var1;
if trt01a='75MG' then trt="&var3";
if trt01a='150MG' then trt="&var4";
if trt01a='300MG' then trt="&var5";
if trt01a='TOTAL' then trt="&var6";
run;
data &var7;
set &var2;
call symputx(trt,ns);
run;
%mend;
%two(var1=one,var2=two,var3=b1,var4=c1,var5=d1,var6=f1,var7=three);
data one;
input NS trt01a $ ;
datalines;
45 150MG
71 300MG
15 75MG
131 TOTAL
; data withoutmacro; set one; if trt01a='75MG' then trt="b1"; if trt01a='150MG' then trt="c1"; if trt01a='300MG' then trt="d1"; if trt01a='TOTAL' then trt="e1"; run; data withoutmacro1; set withoutmacro; call symputx(trt,ns); run;
... View more