| Date: | Wed, 28 Sep 2011 08:13:40 -0500 |
| Reply-To: | Joe Matise <snoopy369@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Joe Matise <snoopy369@GMAIL.COM> |
| Subject: | Re: Proc Import and Excel |
|
| In-Reply-To: | <201109281244.p8SAn2GS018906@waikiki.cc.uga.edu> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
|---|
You can force SAS to read them as text using the DBSASTYPE option. It's
something like this:
proc import file="whatever.xls" data=whatever dbms=excel replace;
dbdsopts=(dbsastype("var1='NUMERIC(8)' var2='CHAR(3)'));
run;
I don't tend to remember the exact combination of ( and = and " for this, so
the above is probably slightly off, but you can google it and get the right
combination, or when I get into work i'll look at some code I have that does
it properly.
-Joe
On Wed, Sep 28, 2011 at 7:44 AM, Jeff Kroll <jeffrey.kroll@us.ing.com>wrote:
> I have multiple spreadsheets Im importing. On one of the spreadsheets a
> column is all numbers on other spreadsheets its mixed. When I bring these
> together I get an error saying the field has been defined as both numeric
> and character. On the spreadsheet that has the values as all numeric I
> tried formatting the column as text but SAS seems to ignore it. Is there a
> way to force SAS to see the column as text? I even tried inserting a row
> after the heading with X's in that particular column but that didnt work
> either. I have many spreadsheets and dont want to have to edit each of
> them.
>
> Thanks
>
> Jeff Kroll
>
|