The back-end CICS program

This program is the CICS back-end application used by the FEPI sample programs.

On the first invocation of the transaction, a map is sent to the terminal.

When there is input from the terminal, CICS invokes the transaction again. The customer data for the customer number from the input is found and sent to the terminal, and further input is awaited. PF3 or CLEAR ends the transaction.

Certain customer numbers cause special processing such as abends and delays, to show how a front-end application could manage such events. The valid customer numbers are:
0001-0005
Normal
0006
Delayed response
0007
Abend before send
0008
Abend after send.
Figure 1. CZBC transaction: customer inquiry
 CZBC                   Customer Inquiry
 Please type a customer number in the range 1 to 9999, then Enter.
 Customer Number . . . . .
          Name . . . . . :
          Balance. . . . :
          Address. . . . :
 Last Transaction Date . :
          F3=EXIT to CICS

Program logic

  Main procedure:
     Set up exception condition handling:
         Map error - SEND_NEW_MAP
         CLEAR/PF3 - END_PROG
     Test COMMAREA
     If transaction not previously invoked
         Call SEND_NEW_MAP
     RECEIVE map
     If customer number not valid
         SEND message
         RETURN
     If customer type is 'ABEND before MAP'
         ABEND
     Build map with customer data
     If customer type is 'LONG DELAY'
         DELAY
     SEND map
     If customer type is 'ABEND after MAP'
         ABEND
     RETURN
  SEND_NEW_MAP routine:
     SEND new map
     RETURN
  END_PROG routine:
     Clear terminal
     RETURN