BookmarkSubscribeRSS Feed
techie
Fluorite | Level 6

Is it possible to find out which particular user had the lock when a batch user wanted to write to the same log location. Can we know which user was trying to use the file at that time?

4 REPLIES 4
Kurt_Bremser
Super User

If you supply the log file name with the -log option on the commandline of your batch job, you can't do anything about this from within SAS, as the job will never start (SAS crashes upon invocation).

 

How you can find a user that keeps you from getting the write lock depends on the operating system; in UNIX, use the fuser command to retrieve the process ID's (numbers), from which you can then list the processes (and their owners) with ps -p.

Sajid01
Meteorite | Level 14

1. There could be an issue of lock if two users are trying to write to the same file. Typically this does not happen.
  Typically locks are not held on folders having log files. (Unless you have some specific batch that is creating a folder)

2. What is your operating system on which the file / folder exists and the job is running?

techie
Fluorite | Level 6
There is a specific batch id that is creating the log files but in this case it doesn't allow to write to the log file stating "Resource is write-locked by another user"

The Operation system used here is Linux
SASKiwi
PROC Star

Typically log file names are date and time stamped right down to hundredths of a second if the SAS jobs are run from a scheduler. That way it is near impossible for two jobs to write to the same log file and encounter a lock. You haven't provided any details on how your log files are named but date and time stamping them should avoid locks. 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1116 views
  • 0 likes
  • 4 in conversation