Help using Base SAS procedures

proc import

Reply
SAS Employee
Posts: 73

proc import

why i am getting below error?

code:
PROC IMPORT OUT= WORK.QWE
DATAFILE= "D:\Documents and Settings\pavan.kumarjupelli\Desktop\AC_Tracker_June09.xls"
DBMS=EXCEL2000 REPLACE;
SHEET="'AC Production_Pavan$'";
RANGE="A2:AP100";
GETNAMES=YES;
RUN;

error:
ERROR: Describe error: The Microsoft Jet database engine could not find the object
''AC Production_Pavan$'$A2:AP100'. Make sure the object exists and that you spell its name and the
path name correctly.
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.79 seconds
cpu time 0.11 seconds

i am trying to import one excel sheet in which var names are in 2nd row and data is starting from 3rd row. i am using sas 8.2.
Super Contributor
Super Contributor
Posts: 3,174

Re: proc import

Posted in reply to Pavan_SAS
It would be most helpful for you to share the expanded SAS log output revealing more about the SAS processing, much as the SAS diagnostic message states, "See SAS Log for details."

Post a reply with the relevant SAS-generated DATA step processing and I expect there will be some particular diagnostic information there -- also you may want to investigate the XLS document as well for possible issues.

Scott Barry
SBBWorks, Inc.
Super Contributor
Super Contributor
Posts: 3,174

Re: proc import

First - check the syntax and exact content of your entire SHEET= keyword, more specifically the surrounding quote and double-quote characters specified (and revealed in the SAS log diagnostic message.

Scott Barry
SBBWorks, Inc.
SAS Employee
Posts: 73

Re: proc import

what i have observed is:

if i have removed the space(between AC and Production) and single quotes which are inside double quotes from sheet name " 'AC Production_Pavan$' ",
means if i will keep as "ACProduction_Pavan$", i am getting the result without any errors.

here i understud that becas of spaces with in the sheet name, they have kept single quotes within double quotes. If i will remove single quotes without removing the space, also i am getting wrong result.

so, now our issues is that how i can read sheet name which contains spaces?
Super Contributor
Super Contributor
Posts: 3,174

Re: proc import

Posted in reply to Pavan_SAS
Have a look at the DOC - both SHEET= and RANGE= parameters can be enclosed in double-quotes. Also there is some mention about coding the trailing "$" for the sheet, which you may want to also review for relevance.

Scott Barry
SBBWorks, Inc.

SAS Support website http://support.sas.com/ - the 9.2 doc here should be relevant to your interests, I would say:

SAS/ACCESS(R) 9.2 Interface to PC Files: Reference
Microsoft Excel Workbook Files
Microsoft Excel Files Essentials
http://support.sas.com/documentation/cdl/en/acpcref/61891/HTML/default/a003103761.htm
Ask a Question
Discussion stats
  • 4 replies
  • 1287 views
  • 0 likes
  • 2 in conversation