DATA Step, Macro, Functions and more

redirecting the output of LOCK LIST to output file insead of Log File.

Reply
Occasional Contributor
Posts: 18

redirecting the output of LOCK LIST to output file insead of Log File.

Hi,
I am writing a macro which will try to lock the dataset using LOCK DS_name command. If due to contention the Lock fails then we need to trigger an email which will contain details about the user/process holding the lock on given table. By using LOCK DS_name LIST we can know this but these details from LOCK LIST get written into Log file. Is there any way to redirect output of this command to some dataset which we can use for sending an email.

Regards,
Amol Deshmukh
Super Contributor
Super Contributor
Posts: 3,174

Re: redirecting the output of LOCK LIST to output file insead of Log File.

SAS 9.2 discussion should lend some guidance. You can use a macro to interrogate the LOCK return code, and then decide what course to take regarding an EMAIL, with condition %IF %THEN %DO / %END code.


Scott Barry
SBBWorks, Inc.

SAS/Share 9.2 DOC: Locking Objects Explicitly (LOCK Statement)
http://support.sas.com/documentation/cdl/en/shrref/59595/HTML/default/a000203048.htm
N/A
Posts: 0

Re: redirecting the output of LOCK LIST to output file insead of Log File.

have a look at ROC PRINTTO.
That will redirect the log to a file from which you can read the messages.

good luck

PeterC
Ask a Question
Discussion stats
  • 2 replies
  • 126 views
  • 0 likes
  • 3 in conversation