> From: An Enquiring Mind
> How is your data step different from the
> below? Am I missing something? Thanks.
> data fc;
> merge forecast(in=a) n_4001 n_4002 ... n_r008;
> by day;
> if a;
> >data n_4001;
> >do until(EndoFile);
> >merge forecast (in=a)
> > n_4001 n_4002 n_4003 n_4004 n_4005 n_4006 n_4007 n_4008
> > end = EndoFile;
> >by day;
> >if a then output;
There is no difference in the output;
The original question said the reason was to optimize the code.
This user-controlled loop structure
set/merge <data set name>
end = EndoFile;
*if condition then;
is supposed to outrun the SAS Supervisor
-- the guy with the PDV sign --
This usage showed significant reductions in data step time used
in earlier versions of SAS, like V6.
I have not done any industrial strength testing on this loop
in quite a while, I picked up this tip either here on SAS-L
or in the book
SAS Programming Tips: A Guide to Efficient SAS Processing.
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
By using your intelligence
you can sometimes make your problems twice as complicated.
-- Ashleigh Brilliant
... or twice as fast
... or half as slow
Efficiency is intelligent laziness. -David Dunham