BookmarkSubscribeRSS Feed
Mn3
Calcite | Level 5 Mn3
Calcite | Level 5

 I am using SAS studio University edition on oracle virtual machine
I am trying to import a data file i have attached below the file. 
using this code
 data cowdiet;
infile "C:\Users\mnaze\OneDrive\Fall2018\ST512\Sofwares\SASUniversityEdition\MyFolder\cowdiet.txt" firstobs=2;
input nitrogen $ barley $ intake;
run;
 downloaded from here: http://www.stat.ncsu.edu/people/gross/courses/ST512/data/
 but it is giving me this error
ERROR: Physical file does not exist,
/opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\mnaze\OneDrive\Fall2018\ST512\Sofwares\SASUniversityEdition\MyFolder\cowdiet.tx
t.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.COWDIET may be incomplete. When this step was stopped there were 0 observations and 3 variables.
WARNING: Data set WORK.COWDIET was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 could you point out if I am making mistake or what could be wrong?

8 REPLIES 8
ballardw
Super User

The University Edition can only find files in the places that the virtual machine the program runs in can see.

 

The set up should have had you create a location referred to as /folders/myfolder.

You file would need to go there or in a subordinate folder and the INFILE should use that location: /folders/myfolder...

Cynthia_sas
SAS Super FREQ

HI, just a clarification. The shared folder location is identified as:
/folders/myfolders

Note the 's' at the end of both words. Then look at the screen shot on this page:
https://support.sas.com/software/products/university-edition/faq/shared_folder_whatis.htm

If your shared folder location is NOT defined as /myfolders, then it is not going to work correctly to access your file. If you use a C: drive location with SAS University Edition, that is not going to work either.

Cynthia

Mn3
Calcite | Level 5 Mn3
Calcite | Level 5
Yeah I had that situation in my mind and infact when I downloaded the SAS i
created the folder SASUniversityedition and a subfolder newfolder in it.
that's the path that I am specifying for this file. But It gives me the
same error.
Reeza
Super User
Are you absolutely sure you placed the file in myfolders and are using the correct path? Find the file in the Servers Files and Folders pane, right click and select properties. That will give you the path.

Use that in your code. If it doesn't work, post a screenshot of the file in Server Files & Folders, your code and log.
Mn3
Calcite | Level 5 Mn3
Calcite | Level 5

2018-11-02.pngYes I am sure I am using the right path as I right click the folder go into properties to copy the file path from there.

 

As suggested in one of the answers to create the folder in C drive: and then define the path by going into the properties of the folder and copied the file path from there. Screenshot attached. 

Then I have tried the following code: 

data cowdiet; 
infile "\\C:\SASUniversityEdition\MyFolders\cowdiet.txt" firstobs=2;
input nitrogen $ barley $ intake;
run;

Same error:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 data cowdiet;
74 infile "\\C:\SASUniversityEdition\MyFolders\cowdiet.txt" firstobs=2;
75 input nitrogen $ barley $ intake;
76 run;
 
ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/\\C:\SASUniversityEdition\MyFolders\cowdiet.txt.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.COWDIET may be incomplete. When this step was stopped there were 0 observations and 3 variables.
WARNING: Data set WORK.COWDIET was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
 
77
78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 I have also tried "
data cowdiet; 
infile "\\C:\SASUniversityEdition\Folders\MyFolders\cowdiet.txt" firstobs=2;
input nitrogen $ barley $ intake;
run;
but I am getting the same error.

 

Cynthia_sas
SAS Super FREQ

Hi:
The C: drive location will NOT work for you when you are using SAS University Edition. You need to copy the Properties from INSIDE SAS Studio, when you see the file, in SAS Studio that's pointed to SAS University Edition, click Properties and then copy the path from your Properties window into the infile statement. Like this:

 

1) Here you see the data on my C: drive in the SASUniversityEdition\myfolders location

_1_cowdiet_in_Windows.png

 

2) BUT, I can't use the C: drive location in my code, so I go over to SAS Studio and right click on the file name from the SAS Studio Files and Folders pane

_2_get_properties_SAS_Studio.png

 

3) I copy the location from the Properties window into my program and run my program

_3_use_location_in_code.png

Note how the location that is showing in SAS Studio is NOT a C: drive location. It is /folders/myfolders/cowdiet.txt -- and THIS is the location that shows in my program.

 

4) The program runs successfully.

_4_code_runs_correctly.png


Here's why you CANNOT use a Windows path in your code in SAS Studio:

You have a computer, a Windows computer that needs to run SAS University Edition.

You put VirtualBox (or VMWare) on your machine as the application that will host SAS in a Virtual Machine.

You install the SAS Virtual Machine into VirtualBox or VMWare.

SAS in the Virtual Machine is running on a Linux image.

 

Basically, think of it as a box in a box in a box

box_in_box.png

 

At the "outer" box level, the Windows level, your shared drive has a "C:" location. but you cannot use this Windows location in your SAS University Edition code. SAS is running in a Linux VM and so, needs a Unix location reference. That's why you set up a shared folder. At the Windows level (#1), you see it as a Windows file. At the SAS level (#3), SAS sees it as a Unix file. So in your code, you need to use a Unix name. The "official" location, on a Windows or a Mac, for the shared folder location is:

/folders/myfolders

 

So a file put into your shared folder location and referenced in your program MUST use the Unix name for the file.

 

Hope this helps. As you can see in my log, with the correct location, your code runs correctly.


Cynthia

Tom
Super User Tom
Super User

SAS University Edition is running in a Unix virtual machine. It is not running directly on your Windows machine. 

You posted a screen shot from your Windows machine. Not a screen shot of the SAS/Studio interface that would show where the file is when viewed from the Unix virtual machine.

But if you have configured your virtual machine right then /folders/myfolders/ should point to the C:\SASUniversityEdition\MyFolders\   folder you can see from Windows.

So your code should look like this instead:

data cowdiet; 
  infile "/folders/myfolders/cowdiet.txt" firstobs=2; 
  input nitrogen $ barley $ intake; 
run;

But remember that Unix is case sensitive. So if the file is really named Cowdiet.txt (with an uppercase C) then Unix will not find it if you look for it with a lowercase c.

ballardw
Super User

@Mn3 wrote:
Yeah I had that situation in my mind and infact when I downloaded the SAS i
created the folder SASUniversityedition and a subfolder newfolder in it.
that's the path that I am specifying for this file. But It gives me the
same error.

Are you using C:\ path or /folders/myfolders/ path on the infile? It won't recognize the first even if it points to the same location for a couple of reasons. First, the virtual machine is running Linux not Windows, path naming conventions are different, second is that the virtual machine starts all paths with /folders/  . It just does not understand C:\ at all.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 1952 views
  • 4 likes
  • 5 in conversation