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
Diamond | Level 26
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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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