Help using Base SAS procedures

SAS File Lock and I/O errors

Reply
Occasional Contributor
Posts: 9

SAS File Lock and I/O errors

Hi,

 

I keep getting SAS I/O Errors or a Filelock issue on a datastep I am trying to run at times on a Unix environment.

 

I have seen the FILELOCKWAIT is set to 0, so how do I change this to 20 seconds in the config file, as I have tried and it does not work.

 

Also does anyone know how to get rid os I/O errors and locking of files as it happens intermittently, or can I access a specific log to check what the issues are?

 

 

Thanks

Reanesh

Super User
Super User
Posts: 7,979

Re: SAS File Lock and I/O errors

AS for your question on file locks, this is discussed in many posts on here.  There are ways to force it, its an os lock not sas, but its not recommended.  Its more of a process issue, why is it that you and someone else are trying to access the same file?  Is there a better way of doing it, the answer to that is yes.  There are various methods - have user areas where files are checked out to and you work on those rather than all on the same files.  Or use a database - that allows concurrent access.  Or choose some warehouse software that can control accesses, assign queues etc.  Many options.

Occasional Contributor
Posts: 9

Re: SAS File Lock and I/O errors

Hi,

 

Thanks for the reply.

 

No one else is accessing this file and I am the user running a few data steps and proc means and this issue appears.

 

I deleted the lock file yet it still appears when I try to re-process the sas program.

 

Can you please advise on a better method please.

 

 

Thanks

Super User
Posts: 5,435

Re: SAS File Lock and I/O errors

This could be due to some fault logic in your program, or some constraint/issue at the OS level. Work closely with your system administrator and try to capture the lock event at the OS level.

Data never sleeps
Occasional Contributor
Posts: 9

Re: SAS File Lock and I/O errors

Hi,

 

I got this error:

 

ERROR: An I/O error has occurred on file RPW.SWITCHER.DATA.
ERROR: File RPW.SWITCHER.DATA is damaged. I/O processing did not complete.

 

When I look in the folder there is a file of this type now:

 

.nfs002d00000006822000001da2

 

Would this suggest a hardware issue as opposed to program?

Super User
Posts: 7,844

Re: SAS File Lock and I/O errors


Reaensh wrote:

Hi,

 

I got this error:

 

ERROR: An I/O error has occurred on file RPW.SWITCHER.DATA.
ERROR: File RPW.SWITCHER.DATA is damaged. I/O processing did not complete.

 

When I look in the folder there is a file of this type now:

 

.nfs002d00000006822000001da2

 

Would this suggest a hardware issue as opposed to program?


That "nfs" lets me suspect that you are working on an NFS mount here. You might have run into a short network outage that caused the error.

My solution: stop working via network mounts and use locally mounted disks.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 7,844

Re: SAS File Lock and I/O errors

A lock problem usually causes this message to be written to the log:

ERROR: A lock is not available for LIBARY.DATASET.DATA.
ERROR: Lock held by process nnnnnnn.

So you need to look in the UNIX ps list for the offending process and determine why it had the dataset open.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 72

Re: SAS File Lock and I/O errors

[ Edited ]

Reaensh,

 

Bummer!

 

Though you have received some good advice and suggestions, I don't think anybody directly answered your question about setting the FILELOCKWAIT option.  Here is an example:

 

libname timing "r:\path" filelockwait=10;

 

HTH!

Best of luck in all your SAS endeavors!

----MMMMIIIIKKKKEEEE
(aka Michael A. Raithel)
Amazon Author's Page: http://www.amazon.com/Michael-A.-Raithel/e/B001K8GG90/ref=ntt_dp_epwbk_0
Ask a Question
Discussion stats
  • 7 replies
  • 584 views
  • 1 like
  • 5 in conversation