Checking Record Locks While Updating PF in Subfiles





Checking Record Locks While Updating PF in Subfiles





RPGLE

Check for %STATUS after doing a CHAIN(E) to file.

If %STATUS = 01218, then record is locked.

RPG

Check for status code 01218 in the file information data structure (INFDS).

Declare INFDS to “F” specification in “Keywords” column – INFDS FILEDS

Now, declare FILEDS as below

I FIELDS                 DS
I                                     *STATUS       STAT

Now, in program, after CHAIN, check for STAT = 01218




No comments