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 (April 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 10 Apr 2006 10:52:28 -0700
Reply-To:   "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject:   Re: Efficiency of Proc sort with out =
Comments:   To: Sarah Gollin <SarahGollin@HBOSPLC.COM>
Content-Type:   text/plain; charset="us-ascii"

Sarah -

The data is sorted in a temp data area that needs approximately three times the space of the original data in either case. The sorted data is then written to the new or old location. The difference is the amount of new storage versus the housekeeping of deleting/overwriting the old dataset.

The time difference is negligible, but using out= to a new space is a wee bit faster. But then you've doubled your storage space, and it's generally a bad idea to have copies of the same data. Try this and see.

data temp; do i=1 to 1e7 by 3; random=ranuni(1); random2=ranuni(2); output; end; run;

proc sort data=temp out=temp2; by random; proc sort data=temp; by random;

proc sort data=temp out=temp2; by random2; proc sort data=temp; by random2; run;

hth

Paul Choate DDS Data Extraction (916) 654-2160

> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Sarah > Gollin > Sent: Monday, April 10, 2006 8:42 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Efficiency of Proc sort with out = > > Hi, > > Just trying to settle an argument. My colleague believes that it is more > efficient to use an out = statement on a proc sort as opposed to > overwriting the original dataset. I have googled this but have been > unable > to come up with a definite answer. Can you help? > > Thanks, > > Sarah


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