Hi! I am on Week 6 of the Getting Started with SAS Programming Coursera course, and am not able to figure how to properly execute the assignment below. I have tried putting the outpath in quotes and without but am still not able to establish a macro variable, please help.
In your EPG1V2 folder, open libname.sas.
Create a macro variable named outpath that stores the filepath to your EPG1V2/output folder: %let outpath=filepath-to-output-folder; Note: In the Server Files and Folders pane, right-click the output folder and select Properties to identify the full path.
Run the code.
Check the log to be sure there are no errors, then save and close the program.
This was the code I tried:
libname PG1 "/home/<user>/EPG1V2/data";
%let outpath=home/<user>/EPG1V2/output;
run;
Did you replace the literal text <user> with your actual userid ?
Your second line is using a RELATIVE filename instead of an ABSOLUTE filename. Can you see the difference?
Note that on most Unix systems you can just use ~ as a short cut for YOUR home directory.
libname PG1 "~/EPG1V2/data";
%let outpath=~/EPG1V2/output;
Also make sure you are using the instructions that are built for the environment you are actually using.
Hi Tom,
Yes, in SAS I put my user ID in the code, however I put user on this forum for privacy reasons. And the issue was just that I had forgotten to include a / at the beginning of the outpath filepath. Thanks for the suggestion!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.