Hello!
I just started learning SAS by following The Little SAS Book using SAS Studio University edition. For one example on the book, I changed the inflie path to the location of the dat file on my laptop which is
'/Users/Zee/Documents/Programming/SASUniversityEdition/myfolders/ToadJump.dat'
the code is like this:
* Create a SAS data set named toads;
*Read the data file ToadJump.dat using list input;
DATA toads;
INFILE '/Users/Zee/Documents/Programming/SASUniversityEdition/myfolders/ToadJump.dat';
INPUT ToadName $ Weight Jump1 Jump2 Jump3;
RUN;
* Print the data to make sure the file was read correctly;
PROC PRINT DATA = toads;
TITLE 'SAS Data Set Toads';
RUN;
One Erro was reported from Log:
'/Users/Zee/Documents/Programming/SASUniversityEdition/myfolders'
compare to the infile path, I don't know why it reports this erro.
(INFILE '/Users/Zee/Documents/Programming/SASUniversityEdition/myfolders/ToadJump.dat')
Please tell me where I got it wrong and how to fix it, really apprecaite your help, thanks!
Your path to your file is correct, but that's not how you reference.
SAS UE is in a VM so it has a 'mapped directory'. From SAS UE which is a separate computer that you're accessing from your computer, the correct code is below. Also, because it's Unix, it's case sensitive so the file name must be specified exactly as it is in the OS.
'/folders/myfolders/ToadJump.dat'
After you add your data to the shared folder. You should be able to see them from SAS Studio "Server Files and Folders".
And to access this shared folder from a SAS program, use /folders/myfolders
.
So for example your path to the data file, should be like
INFILE '/folders/myfolders/ToadJump.dat';
Your path to your file is correct, but that's not how you reference.
SAS UE is in a VM so it has a 'mapped directory'. From SAS UE which is a separate computer that you're accessing from your computer, the correct code is below. Also, because it's Unix, it's case sensitive so the file name must be specified exactly as it is in the OS.
'/folders/myfolders/ToadJump.dat'
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.