Module 10: CICS Transaction Processing
Pseudo-Conversational Processing
Pseudo-conversational processing gives the user the feel of a live conversation while freeing all CICS resources between screens.
After each screen interaction the program ends. When the user presses Enter, CICS starts the program again and hands back the data it saved.
What is pseudo-conversational processing
- The program ends after every interaction with EXEC CICS RETURN TRANSID.
- CICS restarts the program when the user responds, so the user notices no difference.
- Between executions the task, the storage, and the locks are all released.
- It is called pseudo-conversational because the conversation is faked with repeated program starts.
How the program restarts itself
- RETURN TRANSID('xxxx') tells CICS which transaction to start when the user responds.
- The COMMAREA option passes a data area to the next execution.
- CICS saves the COMMAREA in a temporary communication area and passes it back through the DFHCOMMAREA field.
- On restart the program checks EIBCALEN: zero means the first run, non-zero means a returning user.
COMMAREA and DFHCOMMAREA
- Define the communication area in WORKING-STORAGE for use on the RETURN command.
- Define DFHCOMMAREA in the LINKAGE SECTION with the same layout to receive it on restart.
- On the very first execution EIBCALEN is zero and DFHCOMMAREA must not be touched.
- Keep the COMMAREA small - it is saved and restored on every single interaction.
Example of a pseudo-conversational skeleton
- EIBCALEN = 0 means the first execution: send the first map and schedule the next run.
- Otherwise the program is restarting: pick up the saved data from DFHCOMMAREA and process the input.
- WORKING-STORAGE SECTION. 01 CA-AREA PIC X(124). LINKAGE SECTION. 01 DFHCOMMAREA PIC X(124). PROCEDURE DIVISION. 0000-MAIN. IF EIBCALEN = ZERO *--- first execution: show the key map --- MOVE LOW-VALUES TO CA-AREA EXEC CICS SEND MAP('MNTMAP1') MAPSET('MNTSET1') END-EXEC EXEC CICS RETURN TRANSID('MNT1') COMMAREA(CA-AREA) LENGTH(124) END-EXEC ELSE *--- restart: recover saved data, read the input --- MOVE DFHCOMMAREA TO CA-AREA EXEC CICS RECEIVE MAP('MNTMAP1') MAPSET('MNTSET1') END-EXEC PERFORM 1000-PROCESS-INPUT EXEC CICS SEND MAP('MNTMAP2') MAPSET('MNTSET1') END-EXEC EXEC CICS RETURN TRANSID('MNT1') COMMAREA(CA-AREA) LENGTH(124) END-EXEC END-IF.
