BookmarkSubscribeRSS Feed
bheinsius
Lapis Lazuli | Level 10
Hi,

Is it possible to route the log of an Enterprise Guide SAS session, running on the server, to a file on the server?
The reason is that we would like to analyze what the user is doing for query performance optimization.

kind regards,
Bart Heinsius.
7 REPLIES 7
Olivier
Pyrite | Level 9
You have to suböit the following code :

1) prior executing anything else...

PROC PRINTTO LOG="your server directory and file name";
RUN ;

Then all Log messages will be routed to the specified file.

2) you end up all that with :

PROC PRINTTO LOG=LOG ;
RUN ;

--------------

Another (quicker) way to monitor performance without re-reading a whole Log (which is really cumbersome) :

%LET start = DATETIME() ;
/* all code that you want to submit */
%LET end = DATETIME() ;
%PUT It all took only %SYSEVALF(&end - &start) seconds ;
bheinsius
Lapis Lazuli | Level 10
Oliver,

Thanks for your reply.
This would work, but a user has to program that himself.
I would like a generic way to route the log, without the user having to do anything, without him even knowing it.
I tried the altlog option on SAS server session invocation but that only gives startup and shutdown messages of the server session, not what the user executed.

Or do you think that putting the proc printto code in the server autoexec file would do the trick? I expect that the user then doesn't get his sas log in EG anymore.

regards,
Bart.
deleted_user
Not applicable
to allow output and log to appear normally for user, you would have to trap -altlog.
It sounds like you have trapped the wrong -altlog.
If these jobs are started and run by an object spawner, then it is the start-up parameters for "spawned jobs" where you could insert some -altlog options.

Good Luck

Peter
bheinsius
Lapis Lazuli | Level 10
I added the line (just as a test):

-altlog /tmp/sassession.log

to my sasv8.cfg.
After starting the session, running a Listing report on sashelp.class and closing the project, /tmp/sassession.log says:

1 The SAS System 22:10 Saturday, October 28, 2006

NOTE: Copyright (c) 1999-2001 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0)
Licensed to E.O.M. DATA B.V., Site 0088045005.
NOTE: This session is executing on the Linux 2.6.17-2-686 platform.



NOTE: This installation is running Base SAS hot fix bundle 82BX09.


This message is contained in the SAS news file, and is presented upon
initialization. Edit the files "news" in the "misc/base" directory to
display site-specific news and information in the program log.
The command line option "-nonews" will prevent this display.



NOTE: SAS initialization used:
real time 0.05 seconds
cpu time 0.00 seconds

NOTE: Bridge protocol engine is closing connection with client that has concluded processing.
NOTE: The SAS System used:
real time 59.70 seconds
cpu time 0.12 seconds


So I only see the startup and shutdown messages.
deleted_user
Not applicable
sorry to be so late in getting back to this !

You have demonstrated the point I was trying to make.

The infromation that you have trapped is not the session log you seek, but the session spawned by the server ~~ which calls yet-another session where your SAS code is run. I hope one day to discover just where that session's parameters are obtained. I do know that the similar spawning/calling sequence for running SAS DI Studio jobs, results in the autoexec and verbose options being ignored (other options may be ignored but I don't know). "Ignoring" like this guarantees problems, imho.

Somewhere the caller of the session that actually processes your code has parameters like -sysin and perhaps could be extended to accept -altlog. Continue to search and ask.

Good Luck

Peter
Resa
Pyrite | Level 9
Basically we would like to have a same possibility.
We have EG3 available for users via Citrix.
They are using SAS8.2 on UNIX.

In order to get insight in which tables/views are being used by the end-user we would like to have the possibility to scan the log. Therefor an answer to this topic would be highly appreciated.

Or if someone has a better option than using the SAS Log, please feel free to indicate this.
deleted_user
Not applicable
We also have the same problem where the log file is hardcoded in PROC PRINTTO statement. If there is a way to automate it on the server side to create a seperate log file per day per session... that would be highly appreciated.
Thanks!!

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