|
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
|