Highlighted
New Member.
1620 views

External filio

Jump to solution

[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:
CALL "EXTFH" USING FILE-HANDLER-FUNCTION FCD.
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: External filio

Jump to solution
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

View solution in original post

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: External filio

Jump to solution
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

View solution in original post

0 Likes
Highlighted
New Member.

RE: External filio

Jump to solution
can this be switched on/off between individual reads or is it scanned at the open-time of the file
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: External filio

Jump to solution
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)

0 Likes
Highlighted
New Member.

RE: External filio

Jump to solution
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'.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: External filio

Jump to solution
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
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.