Module 5: CICS BMS and Screens
BMS COBOL Program
How a COBOL program uses BMS
- COPY the symbolic map (the generated copybook) into Working-Storage - for example COPY MNTSET1.
- To display: MOVE values to the output fields (suffix O), then SEND MAP FROM the O area.
- To read input: RECEIVE MAP INTO the I area, then read the xxxI data fields and xxxL length fields.
- COPY DFHAID for the attention-key constants (DFHENTER, DFHPF3, DFHCLEAR, DFHPA1...) and test EIBAID to see which key the user pressed.
Typical program flow
- First execution (EIBCALEN = 0): move LOW-VALUE to the O area, SEND MAP with ERASE to show a fresh screen, then RETURN with TRANSID and COMMAREA.
- Next execution: check EIBAID. On Enter, RECEIVE MAP, validate the input, process it (READ/WRITE the file), SEND MAP the result, and RETURN again.
- On invalid input, move an error message to the message field, move -1 to the bad field's length item, and SEND MAP with DATAONLY, ALARM and CURSOR.
- On F3/F12, XCTL back to the menu program or RETURN to CICS instead of redisplaying the map.
Keeping maps and programs in sync
MainframeBug Assistant