Hi All,
Hope you're doing well !!
I created global macro variables from 2 columns in a table i.e, Global_macro. Column_A values will be each global macro variable name and the corresponding each value of Column_B are stored as the macro variable value respectively.
Column_A Column_B
Var put(today(),date7.)
Sum 245866
Max max(135,6546,13)
data _null_; do i=1 to max set work.Global_macro nobs=max; call symput(Column_A,Column_B); end; run;
Some of the macro variables are holding the values as "put(today(),date7.)". When we call the macro variables in SAS program, these're resolving as it is, but not executing the Put function and resolving as the final value in numeric - 12052020.
%put value of &VAR; resolving as put(today(),date7.) .
When we try the below code then working fine. data _null_; var=&VAR; call symput('VAR',var); run;
%put Value of &VAR; resolving to 12052020.
I have been trying this code dynamically to apply for all macro variables from the table Global_macro as below.
data _null_; set work.Global_macro; Col=trim("&")||Column_A; call symput(Column_A,Col); run;
ERROR: The text expression &Var contains a recursive reference to the macro variable VAR. The macro variable will be assigned the null value.
Could someone please suggest me the solution on this.
Many Thanks in Advance !!
Best Regards,
... View more