MainframeMaster

CICS Message Handling

Message handling covers terminal I/O, BMS maps, and program-to-program communication. Core verbs include SEND, RECEIVE, and ROUTE.

Basic I/O

cobol
1
2
3
4
5
6
7
8
9
10
* Send a BMS map EXEC CICS SEND MAP('ORDMAP') MAPSET('ORDSET') ERASE RESP(WS-RESP) END-EXEC. * Receive input EXEC CICS RECEIVE MAP('ORDMAP') MAPSET('ORDSET') RESP(WS-RESP) END-EXEC.

Program Communication

cobol
1
2
3
4
5
6
* ROUTE a message EXEC CICS ROUTE DESTID('OPER') TEXT('Order created') RESP(WS-RESP) END-EXEC.

BMS SEND Flags

  • ERASE: Clears the screen before sending a map.
  • FREEKB: Unlocks the keyboard for input.
  • ALARM: Audible beep to alert operator.
  • DATAONLY: Send only data portion (no attributes).

Error Handling

  • MAPFAIL on RECEIVE: input did not match expected fields; prompt user.
  • INVREQ: invalid map or options; verify mapset is installed.