|
Chris, I will avoid the temptation to ask, "Why not just merge work.target
with the (I hope it just got typo'd) dataset SET into the second datastep."
If I had macro variables &vehnum1-&&vehnum&vehtot and I wanted to use them in
an array in a datastep, I would do something like:
DATA NOMERGE;
ARRAY _VEHNUM (&vehtot) VEHNUM1-VEHNUM&vehtot;
%do ptr=1 to &vehtot;
_VEHNUM(&ptr)=&&vehnum&ptr;
%end;
...other code...
RUN;
The ARRAY statement defines datastep variables using the same names as the
macro variables, and the %do loop assigns each macro variable to the datastep
variable with the same name. You could also replace the %do with a plain do,
and use CALL SYMGET. You might want to RETAIN the variables in the array.
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
|