Date: Tue, 17 Jun 2003 10:42:29 -0700
Reply-To: Steve Goins <chess0001@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Steve Goins <chess0001@YAHOO.COM>
Subject: Re: reading in excel data with proc import
In-Reply-To: <Pine.GSO.4.53.0306171309030.4806@godzilla5.acpub.duke.edu>
Content-Type: text/plain; charset=us-ascii
Yes, another way to import from and export to Excel data is ODBC.
Libname statement shows how to create a library reference to an Excel file. Use ReadOnly = 1; if you want access to be read only.
libname xl odbc noprompt="DRIVER=Microsoft Excel Driver (*.xls);ReadOnly=0;DBQ=c:\files\LookAtStuff.xls;";
Some of the SAS/Access dataset options you might found useful: dbSasType, SasDateFmt, DbNull.
You can access the Excel file and its members as if it were a SAS library with tables, with a few exceptions (you cannot overwrite a sheet, but you can replace a sheet by deleting it first via Proc Delete or Proc SQL, and then writing to the same named sheet).
eoyount@DUKE.EDU wrote:
Hi all,
I have a large excel data set I'm trying to read in. Here's the problem:
it's too long for proc access to read in all records. I'm trying to use
proc import instead, but in some columns, I want them to be character
variables, but the first entry is numeric, so that's how it treats the
column. I would like to avoid splitting the data to smaller files or
saving it as a different format or using DDE.
Is there any way to force proc import to treat columns a certain way? Or
is there another way to import excel data?
Thanks,
Eric
remove synonym for spam to reply
Eric Yount
Senior Data Technician
NC Education Research Data Center
Duke University
---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!