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