The first statement did not "take" so that is why the second statement is not find the macro variable it was supposed to define.
So fix the first statement. And make sure it worked.
%let home = /home/username;
%put &=home;
If you cannot see any problem then delete it and retype it. You might have some other invisible characters from copy and paste that you cannot see that are confusing SAS.
Hi @odrisco4
You'll need to fix your use of the folder separator and macro definition
%let home = /home/<my username>; * Remove trailing /;
filename Totals “&home/Totals.csv”; * Use / instead of \;
I did paste this from a word doc so changing the quotes fixed a few of the errors, but there are still warnings. I still get the last error about running the macro though. I thought maybe a I needed to put /pbr/biconfig/940/Lev1/SASApp/ in front of the file name but that didn't change anything. The files are not in a sub folder, they're directly in /home/username and that's the only file path I get when I check properties.
And names in paths are case sensitive. If the file actual name is "totals.csv" then "Totals.csv" is not the same.
Likely all of your path and the file name should be lower case.
The first statement did not "take" so that is why the second statement is not find the macro variable it was supposed to define.
So fix the first statement. And make sure it worked.
%let home = /home/username;
%put &=home;
If you cannot see any problem then delete it and retype it. You might have some other invisible characters from copy and paste that you cannot see that are confusing SAS.
I added the below and it eliminated one warning but the other warnings and the error are still there.
%let home = /home/username;
%put &=home;
But the error messages should be DIFFERENT now. They should no longer say they cannot find a file with '&home' in its name.
Did you try to ask the SAS/Studio interface to show you the actual name of the file you want to read from as other's have asked?
Remember that Unix filenames are case sensitive. GEORGE.CSV is a different file than either george.csv or George.CSV or ...
This is code, which I retyped in a new window and left out the rest of the program.
This is the log.
Hi,
I don't know what your other errors are or what's in your macro program, but running a test on my SAS OnDemand account with a small CSV file under my /home folder
I can successfully import the CSV file, as shown below:
However, note that when I don't use the correct case for the file name I get the "Physical file does not exist" message:
So this shows that when the path is correct and the quotes are not curly quotes and the slashes are correct, it is possible to point to and read a CSV file that is directly under your /home folder.
Cynthia
I was missing a / and now it works. So I guess retyping the whole thing did it. Thank you everyone for the help.
Remember if you don't start the path the root node then it is a RELATIVE path and not an ABSOLUTE path.
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!
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.