LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 5 Aug 1999 17:05:40 -0400
Reply-To:   MUMMAM1 <MUMMAM1@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   MUMMAM1 <MUMMAM1@WESTAT.COM>
Subject:   Re: stange problem to import execl file to sas file
Content-Type:   text/plain; charset=US-ASCII

Jing -

A couple general things first. When you use the 'import' facility of SAS 6.12, you are actually using PROC ACCESS. If you recall the program, you should be able to see the SAS code that is generated. Note that PROC ACCESS (to my knowledge) CANNOT read Excel 97 files. You may have to save your file as Excel 95. Also, the structure of your data will have to look like the following to use PROC ACCESS:

STATCKNO BOOKID DATE Q2/7 - 297.02 11A01123 011999 Q2/7 - 297.02 11A01124 011999 Q2/7 - 297.02 11A01125 011999 Q2/7 - 297.02 11A01126 021999 Q2/7 - 297.02 11A01127 021999

The code should look something like this: PROC ACCESS DBMS=EXCEL; CREATE WORK._IMEX_.ACCESS; PATH='C:\myfile.xls'; WORKSHEET='Sheet1'; RANGE 'a1..c5'; GETNAMES YES; SCANTYPE=YES; CREATE WORK._IMEX_.VIEW; SELECT ALL; RUN; DATA WORK.mysasset; SET WORK._IMEX_; RUN;

There are other options to import Excel data into SAS (DDE, PROC SQL, etc.). that you may want to look into. My suggestion is that if this a one shot deal, to simply save the Excel file as a text file, and just use a SAS DATA step to read it in.

Mike Mumma Westat


Back to: Top of message | Previous page | Main SAS-L page