The output datastream

To create a 3270 display, you send a stream of data that consists of a write command (1 byte), a write control character or WCC (1 byte) and display data (variable number of bytes).

The WCC and display data are not always present; the write command determines whether a WCC follows and whether data can or must be present.

When you use BMS, CICS® builds the entire data stream for you. The WCC is assembled from options in the SEND command, and the write command is selected from other SEND options and information in the PROFILE of the running transaction. Display data is built from map or text data that you provide, which BMS translates into 3270 format for you.

When you use terminal control commands, such as SEND, CICS still supplies the write command, built from the same information. However, you provide the WCC and you must express the display data in 3270 format.

3270 write commands

There are five 3270 commands that send data or instructions to a terminal:
  • Write
  • Erase/write
  • Erase/write alternate
  • Erase all unprotected fields
  • Write structured fields

The 3270 write command sends the data that follows it to the 3270 buffer, from which the screen (or printer) is driven. Erase/write and erase/write alternate also send the data, but they erase the buffer first (that is, they set it entirely to null values). They also determine the buffer size (the number of rows and columns on the screen), if the terminal has a feature called alternate screen size.

Terminals with this feature have two sizes, default size and alternate size. The erase/write command causes the default size to be used in subsequent operations (until the next erase/write or erase/write alternate command). The erase/write alternate command selects the alternate size.

CICS uses the write command to send data unless you include the ERASE option on your SEND command:

  • If you specify ERASE , CICS uses the PROFILE definition associated with the running transaction to determine whether to use erase/write or erase/write alternate.
  • If you specify ERASE DEFAULT , CICS uses the erase/write command and sets the screen to default size.
  • If you specify ERASE ALTERNATE , CICS uses the erase/write alternate and sets the screen to alternate size).

The erase unprotected to address command causes a scan of the buffer for unprotected fields; these fields are defined more precisely in 3270 field attributes. Any such fields that are found are set to nulls. This selective erasing is useful in data entry operations, as explained in the SEND CONTROL command in Merging the symbolic and physical maps. No WCC or data follows this command; you send only the command.

The write structured fields command causes the data that follows to be interpreted as 3270 structured fields. Structured fields are required for some of the advanced function features of the 3270. They are not covered here, but you can write them with terminal control SEND commands containing the STRFIELD option. For more information, see IBM 3270 Data Stream Programmers Reference.

Write control character

The byte that follows a 3270 write , erase/write , or erase/write alternate command is the write control character or WCC. The WCC tells the 3270 whether to:
  • Sound the audible alarm
  • Unlock the keyboard
  • Turn off the modified data tags
  • Begin printing (if terminal is a printer)
  • Reset structured fields
  • Reset inbound reply mode

In BMS, CICS creates the WCC from the ALARM , FREEKB , FRSET , and PRINT options on your SEND MAP command. If you use terminal control commands, you can specify your WCC explicitly, using the CTLCHAR option. If you do not, CICS generates one that unlocks the keyboard and turns off the modified data tags (these tags are explained in 3270 field attributes).