BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Am a novice in SAS. Have a question that may be pretty basic to most of you.I am trying to read a particular sheet from an Excel file into SAS. I use SAS V8.2 on Windows XP.

I used proc import -

proc import datafile="c:/Shares.xls" out=test1;
sheet="SS_Shr";
run;


but am getting the following error.

ERROR: File _IMEX_.'SS_Shr$'n.DATA does not exist.
ERROR: Import unsuccessful. See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used:
real time 0.15 seconds
cpu time 0.03 seconds


I also 'googled' and tried using -

PROC IMPORT OUT= WORK.auto1
DATAFILE= "C:\Shares.xls"
DBMS=EXCEL REPLACE;
SHEET="SS_Shr";
GETNAMES=YES;
MIXED=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
proc print data=auto1;
run;


but this doesn't work either. The following error message is displayed.

771 PROC IMPORT OUT= WORK.auto1
772 DATAFILE= "C:\Shares.xls"
773 DBMS=EXCEL REPLACE;
NOTE: The previous statement has been deleted.
NOTE: The previous statement has been deleted.
NOTE: The previous statement has been deleted.
774 SHEET="SS_Shr";
775 GETNAMES=YES;
NOTE: SCL source line.
776 MIXED=YES;
-----
180
NOTE: SCL source line.
777 USEDATE=YES;
-------
180
NOTE: SCL source line.
778 SCANTIME=YES;
--------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.

779 RUN;


Can any of you know what I am missing? I am just trying to import a sheet from an Excel file into SAS.

Thx.
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
Refer to these Tech Support notes. There is a special way to refer to sheets:
http://support.sas.com/kb/2/529.html
http://support.sas.com/kb/1/849.html

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Discussion stats
  • 2 replies
  • 858 views
  • 0 likes
  • 2 in conversation