Skip to content
systemcoding.dev
Mainframe

Send a message with EXEC CICS SEND TEXT ERASE

Send plain text to a terminal with EXEC CICS SEND TEXT ERASE in COBOL, which needs no BMS map, on CICS Transaction Server 6.1.

1 min read
Summarize in AI

The simplest CICS program writes a line to the terminal without a screen map, using SEND TEXT. It is a good first transaction and a quick way to show a status message from a program that does not own a mapset.

hello.cblcobol
       WORKING-STORAGE SECTION.
       01  WS-MSG   PIC X(16) VALUE 'HELLO FROM CICS'.
       PROCEDURE DIVISION.
           EXEC CICS SEND TEXT FROM(WS-MSG)
                LENGTH(LENGTH OF WS-MSG) ERASE
           END-EXEC.
           EXEC CICS RETURN END-EXEC.
Text
HELLO FROM CICS

ERASE clears the screen first, so the text appears at the top left. Without it, the text is added to what is already shown.

The data is sent as typed, and a message longer than the screen is split over pages with the terminal's paging commands, which is a reason to keep status text short. The RETURN ends the task, and the terminal stays on the screen until the user presses a key. On CICS TS 6.1 this works for 3270 terminals and for sessions through CICS Web or TN3270 gateways.

Taggedcicscobol
Share

More snippets

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.