BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
neophyte
Calcite | Level 5

Hi, 

I am totally lost in this setup, please help, I am using SAS Studio 9.4

 

 

  • 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;

  1. Run the code.

  2. Check the log to be sure there are no errors, then save and close the program.
 
1 ACCEPTED SOLUTION

Accepted Solutions
tom_grant
SAS Super FREQ
Hello - take the quotes out of the %let statement.
Should be:
%let outpath = S:/workshop/EPG1V2/data;
however the exercise may want you to write the file to another directory under S:/workshop/EPG1V2/ - is there a folder under S:/workshop/EPG1V2/ called output or something like that? If so, then your %let statement should be:
%let outpath = S:/workshop/EPG1V2/output;

View solution in original post

9 REPLIES 9
tom_grant
SAS Super FREQ
Are you using a local install of SAS or SAS OnDemand for Academics?
neophyte
Calcite | Level 5

Hi,

I am using SAS studio for an e-learning virtual Lab. 

tom_grant
SAS Super FREQ
Using the SAS Virtual Lab
The SAS Virtual Lab already has the course files loaded for you. All you have to do is launch the lab and start using SAS Studio.
So I think it would be:
%let outpath=S:/workshop/EPG1V2/data

Note: In some programs in this course you will be asked to replace FILEPATH with the path to your EPG1V2/data folder. For the virtual lab your filepath is S:/workshop/EPG1V2/data. You can view and copy the filepath anytime by right-clicking the data folder and selecting Properties.
neophyte
Calcite | Level 5

Dear Tom,

Thank you very much for your time and efforts, please help me more

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

So Libname.sas is in Demo folder so when I open it, and then I will have to add
Macro.

actual file:

libname pg1 "S:/workshop/EPG1V2/data";
run;

 

Creating Macro:
%let outpath="S:/workshop/EPG1V2/data";
libname pg1 "S:/workshop/EPG1V2/data";
run;

 

and then I will run and below is the result:

NOTE: The SAS System stopped processing this step because of errors.
98 proc export data=pg1.storm_final
99 outfile="&outpath/storm_final.csv"
NOTE: Line generated by the macro variable "OUTPATH".
99 ""S:/workshop/EPG1V2/data"????

 

 

tom_grant
SAS Super FREQ
Hello - take the quotes out of the %let statement.
Should be:
%let outpath = S:/workshop/EPG1V2/data;
however the exercise may want you to write the file to another directory under S:/workshop/EPG1V2/ - is there a folder under S:/workshop/EPG1V2/ called output or something like that? If so, then your %let statement should be:
%let outpath = S:/workshop/EPG1V2/output;
neophyte
Calcite | Level 5

Dear Tom,

 

Thanks a lot, really appreciate your time and efforts. it solved the problem. 

 

 

sarah988
Calcite | Level 5

hi, I did submit the code and I still get an error saying that my pg1.storm_final.data does not exist. 

I am not sure what is the problem can you please help me?

 

the code 

proc export data=pg1.storm_final
outfile="&outpath/storm_final.csv"
dbms=csv replace;
run;

Sobia
Calcite | Level 5

thank you @tom_grant  its really helpful

tom_grant
SAS Super FREQ
When SAS sees the &outpath it will substitute whatever is after the = in the %let statement (including quotes)

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!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 9 replies
  • 2562 views
  • 1 like
  • 4 in conversation