Skip to main content

Why do I occasionally receive a 9/037 status when open a file using LOCKTYPE(2)?

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

Why do I occasionally receive a 9/037 (access denied) file status

when opening a file using LOCKTYPE(2)?

Resolution:

When using LOCKTYPE(2) the File Handler creates a separate data

file with the extension .LCK, against which record locks will

be held.

When a COBOL program closes a file, the File Handler

attempts to delete the lock file as it is no longer required.

The problem arises when this delete operation coincides with

another process that is attempting to open the same data file.

If this process attempts to create a lock file currently being

deleted by the first process a 9/037 can be returned by the operating

system.

This issue is typically only likely to occur if multiple processes

open and close the same files repeatedly.  

Possible workarounds:  

Check the file status following an OPEN operation and reattempt

an open if you receive a 9/037 error.

Do not use LOCKTYPE(2) for files or programs that are susceptible

to this issue.

--> extfh.cfg file where LOCKTYPE(2) set per default and LOCKTYPE 0 set for specific files...

[XFH-DEFAULT]

BASENAME=ON

LOCKTYPE=2

[casspool.dat]

LOCKTYPE=0

[MVSSPL01.DAT]

LOCKTYPE=0

[MyFile.dat]

LOCKTYPE=0

Old KB# 1556

#AcuCobol
#netexpress
#RMCOBOL
#ServerExpress
#COBOL

0 replies

Be the first to reply!