We've been trying to use QDBRRCDL to find out what / who has record locks at the beginning of a nightly batch program. The situation is that people on the overnight shift walk away for "lunch" and leave a particular screen open that ends up locking FILEA. Well, at 2:45 AM a batch job kicks off that allocates and clears FILEA so it can be updated by data from another system.
We were hoping QDBRRCDL would allow us to warn the user and then end their jobs rather than our current process, which is waiting for the computer operator to notice the message, end the job and do a retry on the batch job --- sometimes this isn't happening for hours! Our batch job only runs a few seconds if no one is in FILEA.
My co worker is doing this:
and expects &RL_AVL to be > 0 when the record is locked. We aren't finding that to be the case. He has been struggling with this for a couple of days. Neither of us can see the issue when we are looking at the IBM documentation. Are we incorrect that this API will do what we need it to? Are we using the wrong format? Should we just give it up and go get jobs at Starbucks? (MMMM...coffee..... ) Any push in the right direction will be GREATLY appreciated.
We were hoping QDBRRCDL would allow us to warn the user and then end their jobs rather than our current process, which is waiting for the computer operator to notice the message, end the job and do a retry on the batch job --- sometimes this isn't happening for hours! Our batch job only runs a few seconds if no one is in FILEA.
My co worker is doing this:
PHP Code:
DCL &RL_RCVVAR *CHAR 3216
DCL &RL_LEN *INT VALUE( 3216 )
DCL &RL_FORMAT *CHAR 8 VALUE( 'RRCD0100' )
DCL &RL_RRN *INT VALUE( 0 )
DCL &RESET_IND *CHAR 10 VALUE( '*NO' )
DCL &ERRCODE *CHAR 116 VALUE( X'00000074' )
DCL &ERRLEN *DEC ( 3 0 ) VALUE( 0 )
DCL &RL_AVL *INT VALUE( 0 )
DCL &RL_RTN *INT VALUE( 0 )
/*some other code here*/
CALL QDBRRCDL ( +
&RL_RCVVAR +
&RL_LEN +
&RL_FORMAT +
'FILEA *LIBL ' +
'*FIRST ' +
&RL_RRN +
&ERRCODE +
)​
CHGVAR &RL_AVL %BIN( &RL_RCVVAR 1 4 )
CHGVAR &RL_RTN %BIN( &RL_RCVVAR 5 4 )
IF ( &RL_AVL *EQ 0 ) DO
GOTO CMDLBL(ENDLOOP)
ENDDO​
Comment