Hi, Any one can tell why I could not get my macro variables resolved? Sometimes it worked. Pls see below log. Thanks, Mike
133 %macro aa (_var= xyz0103-xyz0108);
134 DATA varname ;
135 do j=1 to 2;
136 varname=scan( "&_var",j,'-');
137 CALL SYMPUT('tmpvar'||left(j),varname);
138 output;
139 end;
140 RUN;
141 %mend aa;
142 %aa;
NOTE: Numeric values have been converted to character values at the places given by: (Line)Column).
142:99
NOTE: The data set WORK.VARNAME has 2 observations and 2 variables.
NOTE: DATA statement used:
real time 0.02 seconds
cpu time 0.02 seconds
WARNING: Apparent symbolic reference TMPVAR1 not resolved.
WARNING: Apparent symbolic reference TMPVAR2 not resolved.
143 %put tmevar= &tmpvar1 &tmpvar2;
tmevar= &tmpvar1 &tmpvar2
133 %macro aa (_var= xyz0103-xyz0108);
134 DATA varname ;
135 do j=1 to 2;
136 varname=scan( "&_var",j,'-');
137 CALL SYMPUT('tmpvar'||left(j),varname);
138 output;
139 end;
140 RUN;
141 %mend aa;
142 %aa;
NOTE: Numeric values have been converted to character values at the places given by: (Line)Column).
142:99
NOTE: The data set WORK.VARNAME has 2 observations and 2 variables.
NOTE: DATA statement used:
real time 0.02 seconds
cpu time 0.02 seconds
WARNING: Apparent symbolic reference TMPVAR1 not resolved.
WARNING: Apparent symbolic reference TMPVAR2 not resolved.
143 %put tmevar= &tmpvar1 &tmpvar2;
tmevar= &tmpvar1 &tmpvar2