BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12

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.

  

5 REPLIES 5
andreas_lds
Jade | Level 19

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?

Babloo
Rhodochrosite | Level 12

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'?

andreas_lds
Jade | Level 19

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

Babloo
Rhodochrosite | Level 12

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?

Babloo
Rhodochrosite | Level 12

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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 5 replies
  • 3579 views
  • 1 like
  • 2 in conversation