|
"Bucher Scott" <SBucher@SCHOOLS.NYC.GOV> wrote in message
news:98634D42B37B2E4E96CF3A3BD3CD9AE60242526D@EX1VS2.nyced.org...
> Hi Jeff,
>
> In 9.2, I believe you can refer to series of datasets is a similar
> fashion to variables. So the following may work:
>
> Data all;
> Merge var001-var219;
> By id;
> Run;
>
> If you do not have 9.2, a macro could do the job.
> %macro merge_series;
> data all;
> %do i = 1 %to 219;
> var%sysfunc(putn(&i, z3.));
> %end;
> ;
> by id;
> run;
> %mend merge_series;
> %merge_series
>
Using a macro doesn't change, let alone improve, the code - if you turn
mprint on you'll see the list of datasets in all its glory - it just makes
it more obsure.
|