LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 15 Jan 2004 10:01:55 -0500
Reply-To:   "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Subject:   Re: Merging multiple datasets
Content-Type:   text/plain; charset="us-ascii"

> 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; > run; > > >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; > >end;stop; > >run;

There is no difference in the output;

The original question said the reason was to optimize the code.

This user-controlled loop structure do until(EndoFile); set/merge <data set name> end = EndoFile; by Var; *if condition then; output; end;stop;

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


Back to: Top of message | Previous page | Main SAS-L page