BookmarkSubscribeRSS Feed
StickyRoll
Fluorite | Level 6

I am using SAS Studio trying to import an excel in xlsx format.

 

Here is my SAS Script:

FILENAME REFFILE '/sas/config/Lev3/AppData/SAS/housekeeping_config/housekeep_config.xlsx';

PROC IMPORT DATAFILE=REFFILE
DBMS=XLSX
OUT=WORK.IMPORT;
GETNAMES=YES;
RUN;

 

This was also auto-generated by SAS Studio as I double click on the excel that I stored in the server.

 

However, when I execute, i got the following error.

72
73 FILENAME REFFILE '/sas/config/Lev3/AppData/SAS/housekeeping_config/housekeep_config.xlsx';
74
75 PROC IMPORT DATAFILE=REFFILE
76 DBMS=XLSX
77 OUT=WORK.IMPORT;
78 GETNAMES=YES;
79 RUN;
 
ERROR: Physical file does not exist, /sas/config/Lev3/AppData/SAS/housekeeping_config//housekeep_config.
 

This is weird, Why did it show double slash at the end and omitting my file extension (xlsx) in the error log? I also set permission 775 on the server for the folders to ensure it has the sufficient permission.

4 REPLIES 4
Ksharp
Super User
Your path name is not right.
Right click that folder or libname and select its attribution , you should see the right path.
StickyRoll
Fluorite | Level 6

Hi @Ksharp 

I right-click on the excel file itself and copied out the directory. That's where I got the directory from.

 

I made sure the path is right by copying it from the Properties.  I also tried uploading the xlsx to another folder but I am still getting the same error with double slash and missing .xlsx

Ksharp
Super User
I mean right-click the directory/folder which have XLSX file .
Tom
Super User Tom
Super User

The double slash is bug in the error reporting code of PROC IMPORT, so ignore that.

If the computer says a file does not exist then it does not exist (or you don't have access to read it or one of its parent directories).

 

Double check the filename.  Make sure you have the case of the letters in the name or path right (Unix file system is case sensitive). Make sure you are using a location that is valid on the server where your SAS code is running.  Being able to see it on the machine you are using to connect to the SAS server (via SAS/Studio or Enterprise Guide for example) does not count since it needs to exist on the machine were the SAS code is running.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 500 views
  • 0 likes
  • 3 in conversation