09-30-2013 12:13 AM
From the 9.3 SAS doc (see Tip for the %PUT statement):
However, can anyone (a little birdie perhaps?) say why this doesn't work?
%put Y&i=&&y&i; * works ;
%put &=y1; * works ;
%put &=y&i; * does not work ;
or my more realistic example (from a macro I'm writing):
%do i=1 %to 3;
%put Z&i=&&z&i; * works ;
%put &=z&i; * does not work ;
Otherwise, consider this a minor bug report and/or enhancement request.
09-30-2013 12:30 AM
I think its a "feature".
The doco says: "If you place an equal sign between the ampersand and the macro variable name of a ** direct ** macro variable reference, the macro variable's name displays in the log along with the macro variable's value.
It would be good to be able to an indirect reference though.
09-30-2013 12:54 AM
Hi Scott & Jerry,
Yes it does appear to be a feature for only "direct" macros. Thought I'd reference the documentation page as well (look for the Tip), http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#n189qvy83pmkt6n1b...