AS/400 iSeries Submitted Job/Batch Record Lock issue
I am trying to capture a record lock error in a submitted program. The program is coded to capture the File Status as shown below.
I have tested this same record locking capture code in an interactive program and it works with no problems. But for some reason the submitted program doesn't not work the same way.
FSRBNAM UF E K DISK infds(SRWNAM)
D SRWNAM DS
D Status *Status
C DOU Status <> 1218
C EVAL EVENT = 1
C EVAL FMCUST = '000016'
C*
C* Read the Customer Master Record
C FMCUST CHAIN(E) SRBNAM 99
C*
C* Check the File Status, if record was locked, execute subroutine
C* IF %Status(SRBNAM) = 1218
C* Execute Subroutine to handle record lock
C EXSR SR90
C* ENDIF
C*
C ENDDO
My problem is that the subroutine SR90 is not being executed, although I have verified that the Customer Record for 000016 is locked by another program.
When this program is actively running in batch I've looked at the job log and see these entries:
>> CALL PGM(A3DEVSRA/RCDLCKTST2)
Record 26603 in use by job 245024/KLM/QPADEV0149.
? C
Record 26603 in use by job 245024/KLM/QPADEV0149.
? C
No one is manually answering the message, I've looked at the system reply list and don't see a "1218" auto message reply entry.
When I cancel the batch job and look at the job log I see these entries:
00 11/26/08 09:15:43.725168 QWTPCRJA QSYS 010F *EXT
Message . . . . : Job 246458/KLM/RECORDLOCK submitted.
11/26/08 09:15:43.725624 QWTSCSBJ *N QCMD
Message . . . . : -CALL PGM(A3DEVSRA/RCDLCKTST2)
30 11/26/08 09:16:46.741920 QDBSIGEX QSYS 01EA QDBSIGEX
Message . . . . : Record 26603 in use by job 245024/KLM/QPADEV0149.
30 11/26/08 09:16:46.741936 QDBSIGEX QSYS 01EA RCDLCKTST2
To module . . . . . . . . . : RCDLCKTST2
To procedure . . . . . . . : RCDLCKTST2
Statement . . . . . . . . . : 141
Message . . . . : Record 26603 in use by job 245024/KLM/QPADEV0149.
11/26/08 09:16:46.742104 QMHCHGEM QSYS 0146 RCDLCKTST2
To module . . . . . . . . . : RCDLCKTST2
To procedure . . . . . . . : RCDLCKTST2
Statement . . . . . . . . . : 141
Message . . . . : C
11/26/08 09:16:46.742112 QMHCHGEM QSYS 0146 QDBSIGEX
Message . . . . : C
What do I need to change to get my submitted program running in batch to capture the record lock status and allow the subroutine to handle the situation.
Kevin



