Hi,
The following (format statement borrowed from @Patrick) identifies the maximum date range before making use of it in the final data step logic.
/* find the maximum date range that will be required */
data _null_;
do until(last_obs);
set have end = last_obs;
max_range = max(max_range,date_stop-date_start+1);
end;
call symputx('max_range',max_range);
run;
%put &=max_range;
data want(drop = i);
set have;
array date_ [&max_range];
format date_: MMDDYY10.;
do i = date_start to date_stop;
date_[i-date_start+1] = i;
end;
run;
Giving the output:
Thanks & kind regards,
Amir.
... View more