BookmarkSubscribeRSS Feed
ramdantu
Calcite | Level 5

Dear Friends,

I'm trying to write a sample SAS program which suppose to extract data from Excel file @ my Desktop and write the data into my "Work.Age" table in SAS.
But I am getting the error as
"ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\Dantu\Desktop\SASDATA\/Age.xlsx.".

It shows in the log one prefix extra "/" forward slash before "Age.xlsx" which is my input excel. But in the actual code there is no such extra forward slash.

Requesting to help me out in this issue.

Program ==>

PROC IMPORT DATAFILE="C:\Users\Dantu\Desktop\SASDATA\Age.xlsx"
out=work.Age
DBMS=XLSX
REPLACE;
SHEET="AgeTab";
GETNAMES=YES;
RUN;

Error Log ==>

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 PROC IMPORT DATAFILE="C:\Users\Dantu\Desktop\SASDATA\Age.xlsx"
63 out=work.Age
64 DBMS=XLSX
65 REPLACE;
66 SHEET="AgeTab";
67 GETNAMES=YES;
68 RUN;

ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\Dantu\Desktop\SASDATA\/Age.xlsx.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds

69
70 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
83

2 REPLIES 2
ballardw
Super User

The error line like this

 /opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\Dantu\Desktop\SASDATA\/Age.xlsx.".

with mix of /  and \ tells be that SAS is likely executing in a Unix / Linux environment and you told it to look at a windows path. Note the assumption that the windows is subordinate to the SASApp directory.

 

The single most common cause we see here for this is as @Reeza suggests followed by a server SAS install and your Server cannot see your desktop and is looking in the server file system for the file. Which may recquire using one of the wizards or tasks that allows the server to import files on your machine.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 938 views
  • 0 likes
  • 3 in conversation