Learning SAS? Welcome to the exclusive online community for all SAS learners.

Help using infile with txt file on mac using SAS University edition

Reply
New Contributor
Posts: 4

Help using infile with txt file on mac using SAS University edition

I am trying to insert a simple text file using the infile function on mac SAS University edition. I have written

 

infile '/Users/Cody B. Buehler/Documents/School/SASUniversityEdition/myfolders/sasuser.v94/fish.txt'

 

but it comes up with the error

 

The path /Users/Cody B. Buehler/Documents/School/SASUniversityEdition/myfolders/sasuser.v94/fish.txt is not in the list of
accessible paths when SAS is in the lockdown state.
 
Can anyone tell me what I'm doing wrong?
 
(PS I'm new to SAS but have used a lot of Java in the past. Obviously, they are different languages but I understand the basic idea of how to code.)
Super User
Posts: 10,557

Re: Help using infile with txt file on mac using SAS University edition

You need to use the path as it looks from the inside of the virtual machine, probably starting with /folders/myfolders.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 23,992

Re: Help using infile with txt file on mac using SAS University edition

SAS UE is installed in a VM  that runs on your desktop, but you can think of it as running on an external server or a different computer that you're accessing via the web browser. When you followed the installation instructions you set up a shared drive between the VM and your computer as myfolders. You need to either set up a new/different shared folder to the location you're interested in as well or move the data to your myfolders folder and use that. 

 

As indicated you then need to use the path for the VM, not your computer path. 

This the same for all SAS UE users, regardless of Mac/Windows. 

 

You can right click a file in the Servers Files Folders pane and select properties. The file path there is the correct one to use in your programs.

 


cb12991 wrote:

I am trying to insert a simple text file using the infile function on mac SAS University edition. I have written

 

infile '/Users/Cody B. Buehler/Documents/School/SASUniversityEdition/myfolders/sasuser.v94/fish.txt'

 

but it comes up with the error

 

The path /Users/Cody B. Buehler/Documents/School/SASUniversityEdition/myfolders/sasuser.v94/fish.txt is not in the list of
accessible paths when SAS is in the lockdown state.
 
Can anyone tell me what I'm doing wrong?
 
(PS I'm new to SAS but have used a lot of Java in the past. Obviously, they are different languages but I understand the basic idea of how to code.)

 

SAS Super FREQ
Posts: 9,426

Re: Help using infile with txt file on mac using SAS University edition

Hi:

  In addition to the other comments, I suggest you take a look at this forum posting which has an example of reading a .CSV file from a Mac using SAS University Edition: https://communities.sas.com/t5/SAS-Procedures/Help-using-libname-working-SAS-Studio-on-a-Mac-OS-X-Yo...

 

  Although the file is NOT directly a TXT file, the concepts of what the Mac Hard drive path looks like compared to what the code path looks like may help you visualize how your code has to change.

 

cynthia

Ask a Question
Discussion stats
  • 3 replies
  • 234 views
  • 0 likes
  • 4 in conversation