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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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