Just one more choice.
Under my IBM R50 notebook, It spents several second to process ten thousands observations.
[pre]
data _null_;
set temp end=last;
call symput(cats('d',_n_),c);
if last then call symput('nobs',_n_);
run;
%macro data;
data temp;
set temp;
select(_n_);
%do i=1 %to &nobs;
when (&i) d = &&d&i ;
%end;
end;
run;
%mend;
%data
[pre]
[pre]
194 data _null_;
195 set temp end=last;
196 call symput(cats('d',_n_),c);
197 if last then call symput('nobs',_n_);
198 run;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
197:34
NOTE: There were 10000 observations read from the data set WORK.TEMP.
NOTE: DATA statement used (Total process time):
real time 0.25 seconds
cpu time 0.26 seconds
199
200 %macro data;
201 data temp;
202 set temp;
203 select(_n_);
204 %do i=1 %to &nobs;
205 when (&i) d = &&d&i ;
206 %end;
207 end;
208 run;
209 %mend;
210
211 %data
NOTE: There were 10000 observations read from the data set WORK.TEMP.
NOTE: The data set WORK.TEMP has 10000 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 5.39 seconds
cpu time 5.32 seconds
[pre]
Ksharp
... View more