Date: Tue, 18 Jul 2006 00:25:49 -0700
Reply-To: David L Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David L Cassell <davidlcassell@MSN.COM>
Subject: Re: How to change variable type for a entire SAS dataset
In-Reply-To: <200607171830.k6HFKcxP010219@mailgw.cc.uga.edu>
Content-Type: text/plain; format=flowed
sophiDT@HOTMAIL.COM wrote:
>I am importing Excel data into SAS, however, all the variables are read in
>as CHAR, they really should be in NUM. Is there any procedure will fix
>this problem?
>
>Tong
I see you have already received excellent advice on how to fix the
problem afterward.
Let me make a different suggestion. Try to fix the problem before
it occurs. The problem is arising because you are using a spreadsheet
as your database system. This is asking for trouble. As you just
found out. You have columns which have numeric and character data
both. A SAS table is a database. Each column can be numeric. Or
character. But not both. So SAS has to make a judgment call, and
decide what to do with your troublesome data.
If you can fix your Excel data so that the character strings in your
numerics are removed or turned into meaningful missing values,
then SAS can read the data in as numeric.
HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/