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.
7273 FILENAME REFFILE '/sas/config/Lev3/AppData/SAS/housekeeping_config/housekeep_config.xlsx';7475 PROC IMPORT DATAFILE=REFFILE76 DBMS=XLSX77 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.
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
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.