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

Hi Forum,

 

The title is the best description I could think of so I'll describe the issue.

 

Before my time, someone had created a clever method of exporting the results of an EG project to a files server location.

 

In the code there is a line such as;

 

&tmp\reports\oct17\report_results;

The &tmp part is setup somewhere to represent the first part of the UNC path & the rest is the path to the Files folder on the Server.

 

 

After the files are stored there, the code then retrieves it to attach to an email.

 

I haven't seen this setup before & no-one who created it is left to explain it.

 

Can someone help me understand how this works or point me towards some articles books?

 

Thanks  

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

@OscarBoots2

 ....have you seen an example of a variable being used to replace part of a directory path?

Yes, that's quite common, i.e. for implementation of code in a DEV environment which then gets moved to PROD. I'd normally use a macro variable for all root paths so that no code changes between environments are required (i.e. for a change from LEV3 to LEV1).

 

I also want to understand where this info is located.

That totally depends on your actual code. But yes, the macro variable must get created somewhere. &TMP feels like done in your code using either a %LET statement or CALL SYMPUT(). EG also has an option to define code in an EG project to be run when you create a new session - check your SAS log right after connecting to an application server.

 

I want to follow how to export the EG Project results to the Server File Folder

EG is your client. The code gets executed on the server so the results get directly written from the SAS server to the folder location (and that's also the reason why you can't write results to your local C-drive as this drive is not accessible from the Server side).

View solution in original post

4 REPLIES 4
Patrick
Opal | Level 21

@OscarBoots2

Not sure which part you don't understand but in a nutshell:

SAS EG is your client connecting to a SAS server. Execution happens on the server side so you need to thing from the server side. 

 

It appears you SAS process (server side) first creates some files and stores them somewhere on disk, then the process has another step where it sends "stuff" to an email server for execution (SAS takes here the role of the email client).

 

Many sites have all the connection configuration for the email server already done. You can get what has been defined via:

proc options group=email;
run;

If everything is defined and working (ports open) then it's simply about writing correct SAS syntax so SAS sends the necessary information to the mail server. This syntax is fully documented. I've done a quick Google search...

site:support.sas.com 9.4 email

...and got links like:

http://documentation.sas.com/?docsetId=hostunx&docsetTarget=p1hl3t66coao7bn18vrmhx2gte1q.htm&docsetV...

http://support.sas.com/kb/19/767.html

 

 

OscarBoots2
Calcite | Level 5

Thanks Patrick,

 

That's very useful, have you seen an example of a variable being used to replace part of a directory path?

 

I also want to understand where this info is located.

 

Normally there would be a %let Statement to pass the string value of the variable but this '&tmp' value must be stored somewhere else.

 

I want to follow how to export the EG Project results to the Server File Folder for later retrieval & emailing.

 

Thanks again. 

Patrick
Opal | Level 21

@OscarBoots2

 ....have you seen an example of a variable being used to replace part of a directory path?

Yes, that's quite common, i.e. for implementation of code in a DEV environment which then gets moved to PROD. I'd normally use a macro variable for all root paths so that no code changes between environments are required (i.e. for a change from LEV3 to LEV1).

 

I also want to understand where this info is located.

That totally depends on your actual code. But yes, the macro variable must get created somewhere. &TMP feels like done in your code using either a %LET statement or CALL SYMPUT(). EG also has an option to define code in an EG project to be run when you create a new session - check your SAS log right after connecting to an application server.

 

I want to follow how to export the EG Project results to the Server File Folder

EG is your client. The code gets executed on the server so the results get directly written from the SAS server to the folder location (and that's also the reason why you can't write results to your local C-drive as this drive is not accessible from the Server side).

OscarBoots2
Calcite | Level 5

Thanks Patrick,

 

I understand this better now, thank you.

 

I need to see where the &tmp variable path is eet as it isn't done anywhere I can see.

 

There's no %Let or Symput statement or anything stored under Tools >> Options >> SAS Programs 

 

Thanks for your help. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 4 replies
  • 818 views
  • 0 likes
  • 2 in conversation