user2360416
user2360416

Reputation: 125

SAS 9.4 Stored Process Log file monitoring

I am seeing that the log information from a SAS Stored Process (STP) is appended to the .log file only upon completion of the STP. I want to monitor long running STPs by tailing the STP log file. Is there a way to get SAS to write the log information immediately instead of this delayed behavior?

Example: I kick off an STP (stp_test.sas) and tail the log file. The last line see is:

2016-02-19T11:05:03,630 INFO  [00000004] :sassrv - [00000003] STPXUTL Execute using file path:  /SAS/SASHome/SASFoundation/9.4/sasstp/stp_test.sas

Only upon completion (53 seconds later) I get the following next lines including specifically the NOTES that are important to me.

2016-02-19T11:05:56,634 INFO  [00079501] 8:sasmi - STP: 3: Execution Complete.  Status=4
2016-02-19T11:05:56,678 INFO  [00079501] 8:sasmi - NOTE: %INCLUDE (level 1) file /SAS/SASHome/SASFoundation/9.4/sasstp/stp_test.sas is file /SAS/SASHome/SASFoundation/9.4/sasstp/stp_test.sas.
2016-02-19T11:05:56,679 INFO  [00079501] 8:sasmi - NOTE: PROCEDURE SQL used (Total process time):
2016-02-19T11:05:56,679 INFO  [00079501] 8:sasmi -       real time           0.00 seconds
2016-02-19T11:05:56,679 INFO  [00079501] 8:sasmi -       cpu time            0.01 seconds

Upvotes: 3

Views: 662

Answers (2)

Stig Eide
Stig Eide

Reputation: 1062

You can wrap the code in proc printto:

filename stplog temp;
proc printto log=stplog;run;
*your stp goes here;
proc printto;run;

Now, the log will be written to this temp file in the Stored Process Server work directory. I would still add write=immediate as Robert suggested.

Upvotes: 1

Robert Penridge
Robert Penridge

Reputation: 8513

Try the write=immediate option on logparm.

We specify it as a startup parameter when we launch sas:

-logparm="write=immediate"

but you may be able to specify it at runtime too.

Upvotes: 0

Related Questions