SLU P pseudoconversational

This sample program demonstrates using FEPI to obtain data from an IMS back-end transaction. It is in pseudoconversational style, using the FEPI START command to schedule itself when the results arrive.

On the first invocation of the program, a map is sent to the front-end terminal.

When there is input from the front-end terminal, CICS invokes the program again. After establishing a conversation, an inquiry is sent to the back-end system. FEPI START is issued to start this program again when the results arrive. Meanwhile it returns to CICS, so releasing resources.

When the results arrive, FEPI starts the program again. The results are obtained using FEPI RECEIVE, and sent on to the front-end terminal. The conversation is freed and the program returns to CICS to await more input. If the back-end system sends an IMS message, it is sent on to the front-end terminal and the transaction ends.

When PF3 or CLEAR is received from the front-end terminal, the transaction ends. If there is an error, the front-end map is reset. These situations are detected using HANDLE CONDITION.

For clarity, error checking is minimal except for the FEPI commands.

Screen

Figure 1. CZPA transaction: SLU P pseudoconversational sample program
 CZPA             SLUP Sample Program.
 IMS SLUP Pseudoconversational sample program
 This transaction will process SEND/START/RECEIVE requests with MFS
          specified, to a back-end IMS system.
          DATE   :  02/04/92
          TIME   :  10:58:50
          STATE  :  Not Started
 F3=EXIT to CICS  ENTER=obtain time and date stamp from IMS

Program logic

  MAIN procedure:
    If started from terminal
        Test COMMAREA
        If transaction not previously invoked
            Call SEND-NEW-MAP
        Set up exception condition handling:
            Map error - SEND-NEW-MAP
            CLEAR/PF3 - END-PROG
        RECEIVE map from front-end terminal
        FEPI ALLOCATE conversation with back-end system
        Build SLU P data stream to request time
        FEPI SEND data stream to back-end system
        FEPI START transaction
        RETURN
    If started by FEPI
        RETRIEVE start data
        Reaccess conversation using FEPI ALLOCATE PASSCONVID
        If EVENTTYPE = data received
            FEPI RECEIVE data stream from back-end system
            FEPI FREE conversation
            If IMS message received
                SEND message to front-end terminal
                RETURN
            Build data for front-end terminal map
            SEND map to front-end terminal
            RETURN TRANSID(CZPA) with COMMAREA
        Otherwise (timeout or session loss)
            SEND map with message to front-end terminal
            RETURN (freeing conversation implicitly)
  SEND-NEW-MAP routine:
    SEND new map
    RETURN TRANSID(CZPA) with COMMAREA
  END-PROG routine:
    Clear front-end terminal
    RETURN