SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ddormer
Obsidian | Level 7

Hi,

 

I'm trying to import an Excel file into SAS University Edition running on Oracle VirtualBox on a Windows 10 PC.  I've read and tried quite a few posts and solutions, but haven't found the problem.  I've shared myfolder in Windows and set it up in VM.  I can see the folders and files in the Files and Folders tab in SAS Studio.  I have no trouble accessing other files in the shared folder for training exercises.  I've tried placing the input file in both "myfolders" and in a sub directory.  It must be some rookie mistake. 

 

From the Error message, it appears that I have a problem with the shared folder.  Looking for assistance.

 

Thanks in advance for your assistance.

 

Below is my log:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
62
63 %let path=/folders/myfolders/BRFSS15;
64 libname Food "&path";
NOTE: Libref FOOD refers to the same physical library as ORION.
WARNING: Library FOOD does not exist.
NOTE: Libref FOOD was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders/BRFSS15
65
66 Proc Import datafile='folders/myfolders/BRFSS15/foodsecuritydatafile2017.xlsx'
67 Out=work.food
68 DBMS=XLSx
69 Replace;
70 Run;
 
ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/folders/myfolders/BRFSS15//foodsecuritydatafile2017.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.00 seconds
 
71
72
73 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
86
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

@Ddormer

There is potentially more than one issue you have to deal with.

 

The first one:

You're using a relative path in your Proc Import syntax -  datafile='folders/my....' . I guess that's a typo and you just will have to add the beginning slash or you could also use something like: datafile="&path/foodsecuritydatafile2017.xlsx"

 

The second one:

WARNING: Library FOOD does not exist.

That kind of indicates that the path as such doesn't exist. Does library ORION work when you try to access data from it?

View solution in original post

3 REPLIES 3
Patrick
Opal | Level 21

@Ddormer

There is potentially more than one issue you have to deal with.

 

The first one:

You're using a relative path in your Proc Import syntax -  datafile='folders/my....' . I guess that's a typo and you just will have to add the beginning slash or you could also use something like: datafile="&path/foodsecuritydatafile2017.xlsx"

 

The second one:

WARNING: Library FOOD does not exist.

That kind of indicates that the path as such doesn't exist. Does library ORION work when you try to access data from it?

Ddormer
Obsidian | Level 7

Thanks to @Patrick and @Reeza:  I didn't "see" the leading "/".  Then, as Patrick suggested, I had screwed up the shared files settings in my efforts to fix things.  Resetting shared files and adding the back-slash solved the problem.

 

This is my first time using the community.  I am impressed and grateful with the prompt and accurate responses.  Feeling very encouraged.

 

Thank you both!

Reeza
Super User

You forgot the / in front of folders in the datafile option. 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2636 views
  • 0 likes
  • 3 in conversation