I am assigned a project that converts a COBOL batch job to CICS. I know that this is usually a bad idea, but the choice isn't mine. Our users don't want to wait until the next day to get their data.
I have a cics program that updates VSAM files, based on what is in a database for 'process-num' when it is called (process-num is a parameter in FUPLAN-COMMAREA and BARORDER-COMMAREA). The program works fine when it is called to update a plan file and when it is called to update an order file. The problem happens when it is called twice to update both plan and order files.
Batch program FUPLAN contains this code:
EXEC CICS LINK PROGRAM ('FUBAR1')
TRANSID ('EXCI')
COMMAREA(FUPLAN-COMMAREA)
LENGTH (LENGTH OF FUPLAN-COMMAREA)
RETCODE(EXCI-EXEC-RETURN-CODE)
SYNCONRETURN
END-EXEC.
IF EXEC-RESP NOT = 0
SET ABEND-ERROR TO TRUE
DISPLAY 'EXEC-RESP = 'EXEC-RESP' EXEC-RESP2 = 'EXEC-RESP2
SET ADDRESS OF WS-ERROR-MSG
TO EXEC-MSG-PTR
DISPLAY WS-ERROR-MSG
END-IF
TRANSID ('EXCI')
COMMAREA(FUPLAN-COMMAREA)
LENGTH (LENGTH OF FUPLAN-COMMAREA)
RETCODE(EXCI-EXEC-RETURN-CODE)
SYNCONRETURN
END-EXEC.
IF EXEC-RESP NOT = 0
SET ABEND-ERROR TO TRUE
DISPLAY 'EXEC-RESP = 'EXEC-RESP' EXEC-RESP2 = 'EXEC-RESP2
SET ADDRESS OF WS-ERROR-MSG
TO EXEC-MSG-PTR
DISPLAY WS-ERROR-MSG
END-IF
Batch program BARORDER has the same code. The difference between FUPLAN and BARORDER is the data they put in the DB.
The error I get varries somewhat, but the following is an example.
2010-10-18 11:37 05.74 FUBAR1 STARTING EXECUTION
DATE 2010-10-18PROCESS # 05469 PROCESS STAT( )
2010-10-18 11:37 05.81 FUBAR1 STARTING EXECUTION
DATE 2010-10-18PROCESS # 05470 PROCESS STAT( )
FUBAR1 EIBRESP = 00000022 EIBRESP2 = 00000014 ERROR WRITING FILE PLNFILE1
FUBAR1 PLNFILE1 FETCHED 6 RECS 5 WROTE TO PLNFILE1
FUBAR1 2010-10-18 11:37 06.01 W PLNFILE1 ERROR WRITING PLNFILE1
FUBAR1 ABNORMAL EXECUTION
2010-10-18 11:37 06.03 FUBAR1 FINISHED EXECUTION
DFHAC2236 10/18/2010 11:37:06 LRTEST3 Transaction EXCI abend USER in program PLN
resources will be backed out.
FUBAR1 EIBRESP = 00000014 EIBRESP2 = 00000150 ERROR WRITING FILE ORDFILE1
FUBAR1 ORDFILE1 FETCHED 6 RECS 1 WROTE TO ORDFILE1
FUBAR1 2010-10-18 11:37 06.13 W ORDFILE1 ERROR WRITING FILE ORDFILE1
FUBAR1 ABNORMAL EXECUTION
2010-10-18 11:37 06.16 FUBAR1 FINISHED EXECUTION
DFHAC2236 10/18/2010 11:37:06 LRTEST3 Transaction EXCI abend USER in program AIM
resources will be backed out.
DATE 2010-10-18PROCESS # 05469 PROCESS STAT( )
2010-10-18 11:37 05.81 FUBAR1 STARTING EXECUTION
DATE 2010-10-18PROCESS # 05470 PROCESS STAT( )
FUBAR1 EIBRESP = 00000022 EIBRESP2 = 00000014 ERROR WRITING FILE PLNFILE1
FUBAR1 PLNFILE1 FETCHED 6 RECS 5 WROTE TO PLNFILE1
FUBAR1 2010-10-18 11:37 06.01 W PLNFILE1 ERROR WRITING PLNFILE1
FUBAR1 ABNORMAL EXECUTION
2010-10-18 11:37 06.03 FUBAR1 FINISHED EXECUTION
DFHAC2236 10/18/2010 11:37:06 LRTEST3 Transaction EXCI abend USER in program PLN
resources will be backed out.
FUBAR1 EIBRESP = 00000014 EIBRESP2 = 00000150 ERROR WRITING FILE ORDFILE1
FUBAR1 ORDFILE1 FETCHED 6 RECS 1 WROTE TO ORDFILE1
FUBAR1 2010-10-18 11:37 06.13 W ORDFILE1 ERROR WRITING FILE ORDFILE1
FUBAR1 ABNORMAL EXECUTION
2010-10-18 11:37 06.16 FUBAR1 FINISHED EXECUTION
DFHAC2236 10/18/2010 11:37:06 LRTEST3 Transaction EXCI abend USER in program AIM
resources will be backed out.
Any pointers to the right direction will be greatly appreciated.