External filio

[Migrated content. Thread originally posted on 29 May 2012]

The opcodes is:
FhOp-Read-Random-Kept-Lock value x'DB'.
FhOp-Read-Random-Lock value x'DA'.
FhOp-Read-Random-No-Lock value x'8E'.
FhOp-Read-Random value x'F6'.

But the statement
READ SOME-FILE IGNORE LOCK is not the same as FhOp-Read-Random-No-Lock.

Actually FhOp-Read-Random-No-Lock and FhOp-Read-Random behaves same.

What do I need to specify to ignore that the record is locked and aquiring the content?

Does that also work with:
  • Verified Answer

    The IGNORE LOCK functionality is turned on using a bit setting in the FCD description for the file.
    To turn this on set the appropriate bit on and then use a READ RANDOM operation code, for example FAF6.

    Look at the fcd-config-flags - bit 0.

    fcd-config-flags    pic x comp-x
    •    Bit 7 - WRITETHRU
    •    Bit 6 - Use relative byte address
    •    Bit 5 - Update current record pointer
    •    Bit 4 - For FCD2 use fcd-reladdr-big for relative byte address instead of fcd-reladdr-offset
    •    Bit 1 - Call status conversion routine
    •    Bit 0 - Set if IGNORELOCK required

  • can this be switched on/off between individual reads or is it scanned at the open-time of the file
  • This bit setting can be changed between reads.

    Set it before doing the read and you will get the behavior you desire.

    If you want to set it on as if the IGNORELOCK option was set in the configuration file then you would set bit 6 in the following structure:

    fcd-other-flags    pic x comp-x
    •    Bit 7 - OPTIONAL file (OPEN INPUT)
    •    Bit 6 - IGNORELOCK=ON
    •    Bit 5 - Not OPTIONAL (OPEN I/O and EXTEND)
    •    Bit 4 - Filename is EXTERNAL
    •    Bit 3 - Reserved
    •    Bit 2 - NODETECTLOCK directive enabled
    •    Bit 1 - Multiple reel file (record sequential)
    •    Bit 0 - Line advancing file (record sequential)

  • Thanks, worked exactly as expected.
    Out of curiosity, what is the difference between these opcodes?

    FhOp-Read-Random-No-Lock value x'8E'.
    FhOp-Read-Random value x'F6'.
  • The difference comes down to the lock mode that is set on for the file.

    FhOp-Read-Random-No-Lock value x'8E' will always read a record without obtaining a lock for it, regardless of the lock mode used.

    FhOp-Read-Random value x'F6' will either lock a record when read or not lock a record when read depending on the lock mode used in the open.

    If lock mode automatic is set, then FhOp-Read-Random will lock the record.
    If lock mode manual is set, then FhOp-Read-Random will not lock the record.

    fcd-lock-mode pic x comp-x Lock mode flags for shareable files:
    Bit 7 - Lock on multiple records
    Bit 6 - WRITELOCK directive enabled
    Bit 5 - RETRYOPEN=ON
    Bit 4 - SKIPLOCK =ON
    Bit 3 - RETRYLOCK=ON
    Bit 2 - Lock mode MANUAL
    Bit 1 - Lock mode AUTOMATIC
    Bit 0 - Lock mode EXCLUSIVE