BookmarkSubscribeRSS Feed
apat01
Fluorite | Level 6

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.

  1. In your EPG1V2 folder, open libname.sas.

  2. 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.

  3. Run the code.

  4. Check the log to be sure there are no errors, then save and close the program.

3 REPLIES 3
apat01
Fluorite | Level 6

This was the code I tried:

libname PG1 "/home/<user>/EPG1V2/data";
%let outpath=home/<user>/EPG1V2/output;
run;

Tom
Super User Tom
Super User

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?

Spoiler
You forgot to start the path with the root node , / .

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.

apat01
Fluorite | Level 6

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: 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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 493 views
  • 2 likes
  • 2 in conversation