Architecting, installing and maintaining your SAS environment

Begining of session action and end session processing

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Begining of session action and end session processing

I have two macros of which: 1. (_printlog.sas): has to be executed at the start of ever Enterprise Guide session 2. (_printlogend.sas): And the other when the session is done running. Neither of them can be in Enterprise Guide itself - has to be in a configuration and autoexec file. We are running SAS 9.4 on Linux. Let me know if you need more info please. Please be specific in where what should be placed, as I have tried with no success. Many thanks Deon

Accepted Solutions
Solution
‎03-10-2016 06:24 AM
SAS Super FREQ
Posts: 684

Re: Begining of session action and end session processing

Hi

 

From the document you showed, one can not see whether you actually called the macros.

 

the code should look like:

%macro _startjob;

/* your code */
%mend;

%_startJob

Also opening the Listing destination will not help, because SAS Enteprise Guide will generate code that closes all open destinations: (ods _all_ closeSmiley Wink.

 

To collect the SAS Log there better alternatives then the Proc PRINTTO, because using Proc PRINTTO means, you will not see the SAS Log in SAS Enterprise Guide.

 

I suggest you have a look at the mentioned SAS Logging Facility, The App.Program logger is the one you want to use to capture the complete SAS Log of a session.

 

Have a look at this discussion as well https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-log-level-for-the-workspace-server/td-p/...

 

Bruno

View solution in original post


All Replies
SAS Super FREQ
Posts: 684

Re: Begining of session action and end session processing

Is your request just for SAS Enterprise Guide sessions, or any application using a SAS Workspace server?

 

If it is the latter, then have a look at the Logical Workspace Server options > Set Server Properties, there you can set a program to run at the beginning and at the end.

 

Capture.PNG

 

I would also have a look at the SAS Logging Facility, maybe you can get the information you need also out of a log.

 

Bruno

Occasional Contributor
Posts: 12

Re: Begining of session action and end session processing

Hi Bruno_sas, Thank you for that. As I said, we are using a Linux environment. I copy the full path and macro name including .sas into the space. I asume I have to stop and start the Object spawner? Thank you again ...
Super User
Posts: 5,260

Re: Begining of session action and end session processing

At least "Refresh spawner". Just try and see...

Data never sleeps
Occasional Contributor
Posts: 12

Re: Begining of session action and end session processing

Hi All,

 

Thank you for all the help.

 

I have done it and found that it does not do what I intended. Allow me to explain in

the attachment what happened and what I expected.

 

Thank you again.

 

 

 

 

Solution
‎03-10-2016 06:24 AM
SAS Super FREQ
Posts: 684

Re: Begining of session action and end session processing

Hi

 

From the document you showed, one can not see whether you actually called the macros.

 

the code should look like:

%macro _startjob;

/* your code */
%mend;

%_startJob

Also opening the Listing destination will not help, because SAS Enteprise Guide will generate code that closes all open destinations: (ods _all_ closeSmiley Wink.

 

To collect the SAS Log there better alternatives then the Proc PRINTTO, because using Proc PRINTTO means, you will not see the SAS Log in SAS Enterprise Guide.

 

I suggest you have a look at the mentioned SAS Logging Facility, The App.Program logger is the one you want to use to capture the complete SAS Log of a session.

 

Have a look at this discussion as well https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-log-level-for-the-workspace-server/td-p/...

 

Bruno

Occasional Contributor
Posts: 12

Re: Begining of session action and end session processing

Thank you for all that help and made suggestions. Awesome stuff. Love this forum.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 771 views
  • 2 likes
  • 3 in conversation