Screen image SEND and START

This sample program demonstrates using FEPI to send formatted data to a back-end transaction, and requesting a transaction to be started when the reply to the data arrives.

This program is the SEND part of a SEND-RECEIVE pair of programs, the RECEIVE part being DFH0VZTR.

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

When there is input from the front-end terminal, CICS invokes this send transaction again. The customer number is extracted from the input. Using FEPI ALLOCATE a conversation is started with the back-end system. Then FEPI SEND with screen image data is used to start a back-end transaction. FEPI START is issued to specify that the receive transaction is to be started when the back-end system replies.

In due course, the receive transaction is started and XCTLs to this send transaction. The customer number can now be sent to the back-end using FEPI SEND with screen image data. FEPI START is again issued.

The receive transaction gets the results from the back-end transaction and sends them on to the front-end terminal.

When there is more input from the front-end terminal, CICS invokes this transaction again. FEPI ALLOCATE with PASSCONVID is issued to gain ownership of the conversation and the customer number is sent to the back-end as before. The cycle continues until PF3 or CLEAR is received. These are passed on to the receive transaction (using the FEPI START user data) and to the back-end transaction to indicate that it is to end.

Figure 1. CZTS transaction: customer name and balance inquiry
 CZTS                   Customer Name and Balance Inquiry
 Please type a customer number in the range 1 through 9999, then Enter.
 Customer number . . . . .
          Name . . . . . :
          Balance. . . . :
          F3=EXIT to CICS

Program logic

  MAIN procedure:
    Test COMMAREA
    If transaction not previously invoked
        Call SEND-MAP
    If first customer number to process
        Call CONTINUE-CONVERSATION
    Set up exception condition handling:
        Map error - SEND-MAP
        PF3/CLEAR - CONTINUE-CONVERSATION
    RECEIVE MAP from front-end terminal
    If conversation not started
        Call INITIATE-CONVERSATION
    Else
        Call CONTINUE-CONVERSATION
  SEND-MAP routine:
    SEND new map to front-end terminal
    RETURN TRANSID(CZTS) with COMMAREA
  INITIATE-CONVERSATION routine:
    FEPI ALLOCATE conversation with back-end
    Build screen image to invoke back-end transaction
    FEPI SEND screen image to back-end
    FEPI START the receive transaction
    RETURN
  CONTINUE-CONVERSATION routine:
    Unless first customer number
        Reaccess conversation with FEPI ALLOCATE PASSCONVID
    Build screen image to send customer number
    FEPI SEND screen image to back-end
    FEPI START the receive transaction
    RETURN