|
<hs AT dc-sug DOT org ("Howard Schreier)> wrote in message
news:200808050121.m74Ilim5019094@malibu.cc.uga.edu...
> On Tue, 5 Aug 2008 00:40:09 GMT, Lou <lpogoda@VERIZON.NET> wrote:
>
> ><hs AT dc-sug DOT org ("Howard Schreier)> wrote in message
> >news:200808040153.m73AlDCD015752@malibu.cc.uga.edu...
> >> PROC SQL claims to be able to do this. To illustrate:
> >>
> >> proc sql;
> >> create table demo as
> >> select *
> >> from sashelp.class;
> >> alter table demo
> >> drop age, weight;
> >> quit;
> >>
> >> Log shows:
> >>
> >> NOTE: Table WORK.DEMO has been modified, with 3 columns.
> >>
> >> However, evidence indicates that behind the scenes PROC SQL transcribes
> >the
> >> body of the table, so you will end up incurring the cost of
re-creating.
> >
> >PROC SQL makes no such claim
>
> The first sentence of the doc page for ALTER says "Adds columns to, drops
> columns from, and changes column attributes in an existing table."
> (http://tinyurl.com/56qm6p or
> http://support.sas.com/onlinedoc/913/getDoc/en/proc.hlp/a002473671.htm).
Well, I guess you could construe that sentence to mean it drops columns from
a table "in place", that is without rewriting the entire dataset. However,
you could make the same statement about the following DATA step (as far as
dropping a column is concerned at any rate)"
DATA FEE (DROP = FIE);
SET FEE;
RUN;
Neither the DATA step nor PROC SQL appear to get rid of a column without
rewriting the table/dataset. If you make your test table/dataset large
enough that the process takes a minute or three, you can open a Windows
Explorer window on the library containing the file and by clicking on
View>Refresh a few times, watch it happening.
|