Created On:  27 January 2012

Problem:

When trying to read indexed ISAM files the user receives a file status code 37.

037 File access denied (Fatal)

Your attempt to access a file has been denied by the operating system. You might have tried to write to a write-protected file or you could have tried to read from an output device.

Resolution:

Alter the access permission on the relevant file. Access can be read-only, if you just want to read the contents of the file without making any changes, or it can be read and write in which case you can alter its contents.

Is this file using LOCKTYPE=2?

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

Incident #2546831