Date: Tue, 5 Aug 2008 18:41:15 -0700
Reply-To: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Subject: Re: dropping one variable from a huge dataset without recreating
In-Reply-To: <BW6mk.402$7N1.339@trnddc06>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
On Aug 5, 2008, at 6:15 pm, Lou wrote:
>> 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.
On the other hand, if the data set is always rewritten, why this note?
=====
Note: You cannot change the length of a numeric column with the
ALTER TABLE statement. Use the DATA step instead.
=====
What reason could there be for allowing me to change the length of a
character variable, but not of a numeric variable.
--
Jack Hamilton
jfh@alumni.stanford.org
|