Screen image RECEIVE and EXTRACT FIELD

This sample program demonstrates using FEPI to get formatted data from a back-end transaction.

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

This transaction is started by CICS either when data is received from the back-end transaction or if no data is received in the time set in the send transaction, as is determined from the start data obtained with RETRIEVE. The user data in the start data indicates whether the conversation is starting, continuing, or finishing.

A FEPI RECEIVE obtains the screen image from the back-end transaction and FEPI EXTRACT FIELD is used to obtain specific fields.

If the conversation is starting, control is passed to the send transaction using XCTL to allow an inquiry to be sent to the back-end transaction.

If the conversation is continuing, the results from the back-end are sent on to the front-end terminal. Access to the conversation is relinquished, and control is returned to CICS specifying that the send transaction is to be invoked when there is next user input.

If the conversation has finished, a message to that effect is sent to the front-end terminal. The conversation is freed and the transaction ends.

Program logic

  MAIN procedure:
    RETRIEVE start data
    Reaccess conversation with FEPI ALLOCATE PASSCONVID
    If time out
        Call REPORT-PROBLEM
    FEPI RECEIVE back-end screen image
    If conversation ending (PF3 or CLEAR indicated)
        Call REPORT-PROBLEM
    If back-end problem
    (CICS message or back-end transaction message)
        Call REPORT-PROBLEM
    If conversation starting (user data has customer number)
        XCTL to program DFH0VZTS
    If conversation continuing
        Get interesting fields from back-end data using
            FEPI EXTRACT FIELD
        Build and send map to front-end terminal
        Release conversation using FEPI FREE PASS
        RETURN TRANSID(CZTS) with COMMAREA
  REPORT-PROBLEM routine:
    SEND message to front-end terminal
    FEPI FREE conversation
    RETURN