|
Dear SAS-Lers,
How can I reference the macro variables: NAME1, NAME2, NAME3 .. NAME12
using something like this: &NAME.&w. where w is the number .
I have macro variable names: NAME1, NAME2, NAME3 .. NAME12
In stead of referencing them as &NAME1., &NAME2., &NAME3. ... I want to use
a counter in a DO-loop:
%MACRO tstput;
%let w=0;
%do i=1 %to 12;
%let w=%eval(&w.+1);
%put &NAME.&w.; /* this do not work !! */
%end;
%MEND tstput;
%tstput;
:::::::::::::::::::::::::::::::::
Torben Haslund
Department of Plant Biology
Swedish University of Agricultural Sciences
P.O. Box 7080
S - 750 07 UPPSALA, Sweden
E-mail address: Torben.Haslund@vbiol.slu.se
Home and postal address: Ostre Paradisvej 7B,
DK-2840 HOLTE, Denmark
Phone home: +45 4541 1198
|