BookmarkSubscribeRSS Feed
dav_amol
Calcite | Level 5
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
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
deleted_user
Not applicable
have a look at ROC PRINTTO.
That will redirect the log to a file from which you can read the messages.

good luck

PeterC

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1282 views
  • 0 likes
  • 3 in conversation