Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 8: CICS Program and Data Passing


Pseudo-Conversational Programming

Conversational vs pseudo-conversational

  • In a conversational program, the task stays alive while the user thinks and types.
  • The program issues RECEIVE and waits. All its storage and resources stay locked during the wait.
  • This wastes resources. A user thinking for two minutes holds storage, enqueues and file locks for two minutes.
  • In a pseudo-conversational program, the task ends after each screen interaction.
  • The program saves its state in a COMMAREA or channel and issues RETURN TRANSID.
  • When the user presses a key, CICS starts the program again and passes the saved state back.
  • To the user it looks conversational. To CICS it is a series of short tasks. That is why it is called pseudo-conversational.

How pseudo-conversational processing works

  • First execution: EIBCALEN is 0. The program shows the first screen and ends with RETURN TRANSID + COMMAREA.
  • CICS saves the COMMAREA data in a temporary communication area.
  • Next execution: the program restarts, DFHCOMMAREA holds the saved data, and EIBCALEN is not 0.
  • The program moves DFHCOMMAREA to its working area, processes the user input, shows the next screen, and RETURNs again.
  • The last screen ends with a plain RETURN, which ends the task for good.
  • Example:-
    PROCEDURE DIVISION. 0000-MAIN-PARA. IF EIBCALEN = 0 PERFORM 1000-FIRST-TIME ELSE MOVE DFHCOMMAREA TO CA-AREA PERFORM 2000-PROCESS-INPUT END-IF. EXEC CICS RETURN TRANSID('PRGA') COMMAREA(CA-AREA) END-EXEC.

Rules for pseudo-conversational programs

  • Always check EIBCALEN at the start to know if this is the first execution.
  • Keep the COMMAREA small. Store only state data like screen counts and keys, not whole records.
  • Release enqueues before RETURN TRANSID so other tasks are not blocked during think time.
  • Re-read any record you plan to update, because another task may have changed it while the user was thinking.
  • The TRANSID on RETURN must be defined in the PCT.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant