BookmarkSubscribeRSS Feed
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?

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.

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?

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
Opal | Level 21

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 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 4 in conversation