BookmarkSubscribeRSS Feed
ferlopz298
Calcite | Level 5

Hi,

    I am unable to use the infile statement on SAS University on my MAC book. I have the folders setup in Documents>SASUniversity>myfolders>text>list1.txt

 

I get this error:

ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/folders/myfolders/text/list1.txt

 

The code I have tried to use after reading similar forums is:

Infile '/folders/myfolders/text/list1.txt';

 

I really need to get this to work if I am going to learn SAS and practice for the Base 9 exam. If you are familiar with how SAS reads files on MACS please provide feedback. The other forums I read said the infile should start with '/folders/myfolders/' but that doesn't do anything for me. I appreciate your help!

8 REPLIES 8
Kurt_Bremser
Super User

Are you 100% sure that you used

infile '/folders/myfolders/text/list1.txt';

and not

infile 'folders/myfolders/text/list1.txt';

?

Please post the whole log of the failing step, using the {i} button.

ferlopz298
Calcite | Level 5

Yes, the code reads:

 

Data Number;
Infile'/folders/myfolders/text/list1.txt';
Input Num1 Num2;
run;

 

It still says ERROR: Physical file does not exist

 

Do you think my shared folder was setup incorrectly? it was setup under Documents in Mac

ferlopz298
Calcite | Level 5
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 Data Number;
74 Infile'/folders/myfolders/text/list1.txt';
75 Input Num1 Num2;
76 run;
 
ERROR: Physical file does not exist, /folders/myfolders/text/list1.txt.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.NUMBER may be incomplete. When this step was stopped there were 0 observations and 2 variables.
WARNING: Data set WORK.NUMBER was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
 
 
77
78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
Kurt_Bremser
Super User

That's different from your original post, where SAS complained about "/opt/sasinside/SASConfig/Lev1/SASApp/folders/myfolders/text/list1.txt".

 

Still, when SAS tells you that a file is not there, it's not there. Can you see the file in the file browser of SAS Studio?

Cynthia_sas
SAS Super FREQ

Hi:

  Just to clarify the ERROR that shows "/opt/sasinside" is very easy to generate in SAS University Edition. All you have to do is get some part of the path incorrect, or refer to a drive location instead of /folders/myfolders/ or not define your shared folder location correctly. For example, when I refer to a C: drive location in SAS University Edition, I can generate the same kind of "/opt/sasinside" error, as shown below:

generate_optinside_error.png

Here, my code was in a datafile= option, but it could just have easily been an INFILE or a FILE statement or a FILE= option. Notice how the /opt/sasinside/SASConfig/Lev1/SASApp server folder path is pre-pended to the C: drive location path, resulting in a non-existent location, as far as the Virtual Machine is concerned.

 

  This is an example from Programming 1, but could be an error with any Excel, TXT or CSV file that you are trying to read/import.

 

  Let's take a step back and look at an example of what a shared folder location looks like on the Mac, in Finder:

mac_before_making_data.png

This is a screen shot of SASUniversityEdition/myfolders on a Mac. Focus on the bottom line of Finder:

mac_location_closeup.png

The name of the shared folder is in a very long Macintosh path for a student named Lee. So he's placed his SASUniversityEdition folder in 

/Documents/Documents - Lee's iMac/SASUniversityEdition/myfolders

and then in that location unzipped the EPG194 zip file so he's got a subfolder also called EPG194 and then under THAT folder are more folders called: activities, data, demos, output, practices, as shown in the Finder window.

 

  It would be incorrect to use ANY of the full Mac path in any code, just as it was incorrect in my first screen shot to use any of my C: drive location in the code.

 

  To find the name of the folder you're interested in (or of the individual file you're interested in), in SAS University Edition, 

find_properties.png

Note that you do NOT see any part of the Mac file or folder names in the Location pane.

 

  First indication of a problem -- do you see My Folders at the top of the Server Files and Folders pane? If so, that is good, it means you've defined your shared folder location correctly.

 

  Second thing to check -- do you see your file or folder of interest underneath the My Folders location? If yes, even better -- now you just have to do the Properties step to get the location you need. But if you do NOT see you file or folder underneath the My Folders location, it's a good time to use Finder and locate your file on the Mac file system and then MOVE it to your shared folder location.

 

  Third thing to check -- is everything spelled right and in the right case? There is a difference between:

/folders/myfolder   --> No trailing s

folder/myfolders   --> no leading slash, folder instead of /folders/myfolders

/folders/myfoldres  --> myfolders misspelled as myfoldres

/folders/my folders  --> no space in myfolders

 

and

/folders/myfolders

 

Bottom line, if you can see your data file for the INFILE statement in your /folders/myfolders location inside SAS Studio, then ALL you need to do to get the correct info for the INFILE statement is right click on the file name, choose Properties, and look at the fully qualified name that you see in the Properties window.

 

If you do NOT see your file in the /folders/myfolders location, then you need to get it there.

 

Hope this helps,

Cynthia

Tom
Super User Tom
Super User

Your error message is saying that it is trying to find the /folder directory under the current working directory that the SAS process is using. That means it looks like it is either not seeing the / at the front of the string in your code or there is some other character in front of the / that is in your code that is not showing in your error message.

Compare the log when you use these three slightly different lines.

infile '/folders/myfolders/text/list1.txt';
infile ' /folders/myfolders/text/list1.txt';
infile 'folders/myfolders/text/list1.txt';

Can you find the file in the files panel on the left in the SAS/Studio interface? 

If so then get the properties for the file from there. That will show the path that SAS/Studio GUI is using to find the file. Copy that path and paste it into your program.

 

 

Cynthia_sas
SAS Super FREQ

Hi:

  Another issue you may have is that you are specifically told to make a folder on your Mac called "SASUniversityEdition" with a subfolder of "myfolders" on your Mac hard drive. So the shared folder location should be:

/high-level-path-on-Mac/SASUniversityEdition/myfolders

 

  Yet, it looks like you named your folder "SASUniversity/myfolders" and that could be causing some of your problems, as well.

Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 8 replies
  • 3727 views
  • 1 like
  • 4 in conversation