DATA Step, Macro, Functions and more

How to kill the process while the file is in use?

Reply
Super Contributor
Posts: 426

How to kill the process while the file is in use?

I got an error as follows while reading the file. Only I work on this file and I've closed it before running SAS program. Could someone guide me to overcome this error?

 

NOTE: The variable fname exists on an input data set, but was also specified in an I/O statement option.  The variable will not be 
      included on any output data set.
Resource is write-locked by another user.  File 
=/usr/sas/sas_config/Lev1/SASApp/StoredProcessServer/Logs/SASApp_STPServer_2015-09-29_tmp_18208.log.  System Error Code = 
0.
ERROR: File is in use, /usr/sas/sas_config/Lev1/SASApp/StoredProcessServer/Logs/SASApp_STPServer_2015-09-29_tmp_18208.log.

  

Super Contributor
Posts: 259

Betreff: How to kill the process while the file is in use?

SASApp_STPServer_2015-09-29_tmp_18208.log seems to be a log file automatically created by stp server. Why do you want to read/write it?

Super Contributor
Posts: 426

Betreff: How to kill the process while the file is in use?

I need to read the log file to create a dataset. My question is how to get rid of the error 'file is in use'?

Super Contributor
Posts: 259

Betreff: How to kill the process while the file is in use?

[ Edited ]

Can you check which process is responsible for the lock? Afaik the STP-server and its sas-processes do not lock their log files.

 

Edit: http://superuser.com/questions/97844/how-can-i-determine-what-process-has-a-file-open-in-linux

Super Contributor
Posts: 426

Betreff: How to kill the process while the file is in use?

My log file is in the below location. I did checked the process running in this folder and I could found below.

 

-bash-4.1$ lsof /usr/sas/tir/test/loganalysis/
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /root/.gvfs
      Output information may be incomplete.
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
bash     6394  sas  cwd    DIR  253,2     4096 9718657 /apps/tir/test/loganalysis
lsof    10676  sas  cwd    DIR  253,2     4096 9718657 /apps/tir/test/loganalysis
lsof    10677  sas  cwd    DIR  253,2     4096 9718657 /apps/tir/test/loganalysis
-bash-4.1$ 

 

Do I need to kill all the PID?

Super Contributor
Posts: 426

Betreff: How to kill the process while the file is in use?

I could not delete that process as well. Could someone  guide me?

Ask a Question
Discussion stats
  • 5 replies
  • 644 views
  • 1 like
  • 2 in conversation