Module 10: CICS Transaction Processing
Conversational Processing
A conversational program holds one continuous conversation with the terminal user from the moment the transaction starts until it ends.
The task stays alive the whole time, waiting for the user to type input and press Enter. The program, its storage, and any file locks stay reserved while the user thinks.
What is conversational processing
- A conversational program keeps the task alive across every screen interaction with the user.
- The program sends a map, waits on a RECEIVE, processes the input, sends the next map, and waits again - all inside one task.
- The conversation ends only when the program issues a plain RETURN with no TRANSID option.
- It is called conversational because the program talks back and forth with the user like a live conversation.
How a conversational program works
- The transaction starts when the user enters the trans-id or when control is passed to the program.
- The program sends the first screen with EXEC CICS SEND and then issues EXEC CICS RECEIVE to wait for the user's input.
- While the user reads the screen and types, the task is suspended but all of its resources stay reserved.
- The program keeps looping through SEND and RECEIVE until the user finishes, then ends with RETURN.
Drawbacks of conversational processing
- Resources are wasted: the task, program storage, and the terminal stay tied up during user think time.
- File locks taken for update can stay held for minutes, blocking other users.
- Fewer users can work at the same time because each active user holds a task slot.
- That is why production CICS applications use pseudo-conversational processing instead.
Example of a conversational program skeleton
- The task starts, sends the key map, and waits for input with RECEIVE.
- After processing, it sends the data map and waits again - the task never ends between screens.
- PROCEDURE DIVISION. 0000-MAIN. EXEC CICS SEND MAP('MNTMAP1') MAPSET('MNTSET1') END-EXEC. EXEC CICS RECEIVE MAP('MNTMAP1') MAPSET('MNTSET1') END-EXEC. *--- process the input, then send the next screen --- PERFORM 1000-PROCESS-INPUT. EXEC CICS SEND MAP('MNTMAP2') MAPSET('MNTSET1') END-EXEC. EXEC CICS RECEIVE MAP('MNTMAP1') MAPSET('MNTSET1') END-EXEC. PERFORM 2000-PROCESS-INPUT. *--- conversation over: end the task --- EXEC CICS RETURN END-EXEC.
- Notice the plain RETURN at the end: it ends the task without scheduling another execution.
