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 (May 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 7 May 2009 10:32:56 -0400
Reply-To:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:   Re: Dropping variables efficiently

with a small amount of obs SQL is faster. If the number of obs is higher, a view seems to be more efficient (SQL has to rewrite the dataset, I think. No other possibility for a relational table):

data b x; set sashelp.class; do i=1 to 10000; output; end; run;

proc sql; alter table b drop name ; quit ;

data c; set b; run;

data a / view=a; set x(drop=name); run;

data c; set a; run;

Gerhard

On Thu, 7 May 2009 16:08:33 +0200, karma <dorjetarap@GOOGLEMAIL.COM> wrote:

>Proc SQL's alter table should be more efficient: > >proc copy in=sashelp out=work ; > select class ; > run ; >proc sql; > alter table class > drop name ; > quit ; > >log: >219 proc sql; >220 alter table class >221 drop name ; >NOTE: Table WORK.CLASS has been modified, with 4 columns. >222 quit ; > > >NOTE: PROCEDURE SQL used: > real time 0.00 seconds > cpu time 0.00 seconds > > >2009/5/7 Paul <paulvonhippel@yahoo.com>: >> Is there a more efficient way to drop variables than the obvious? >> >> data a; >> set b (drop = x y); >> run; >>


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