3270 Data Stream

The 3270 data stream is a buffer-oriented data stream. The print data is formatted as if it were going to be displayed on a screen. The host system sends commands to format the presentation space. These commands can change the presentation space in any location at any time. Once the host system completes formatting the presentation space, it issues a START PRINT command and the presentation space is printed as accurately as the printer hardware allows.

Table 1 lists the commands that can be sent in the 3270 data stream.

Table 1. 3270 Data Stream Commands
Command Meaning
W Write
EW Erase/Write
EWA Erase/Write Alternate
RB Read Buffer
RM Read Modified
RMA Read Modified All
EAU Erase All Unprotected
WSF Write Structured Field

Table 2 lists the orders that can be sent in the 3270 data stream.

Table 2. 3270 Data Stream Orders
Order Meaning
SBA Start Buffer Address
SF Start Field
IC Insert Cursor
PT Program Tab
RA Repeat to Address
EUA Erase Unprotected to Address
SFE Start Field Extended
SA Set Attribute
MF Modify Field

The last three orders in the preceding table manage the color, extended highlighting, and programmed symbols attributes for fields and individual characters. The programmed symbols attribute is not supported by PC/3270.

In addition to the commands and orders in the two preceding tables, there are special printer formatting control codes that can be included in the 3270 data stream.

The following table lists the control codes that can be sent in the 3270 data stream.

Table 3. 3270 Data Stream Format Control Codes
Code Description
NL New Line control code moves the print position to the left margin and down one line.
CR Carriage Return control code moves the print position to the left margin.
EM End of Message control code ends the print operation.
FF Form Feed control code moves the print position to the left margin at the top of the next page.
Note: NL, CR, and EM are valid only if a line-length format specified by the WCC is not used. The FF code is valid in any buffer position.

PC/3270 printer support interprets each 3270 attribute and printer control code and translates them into a sequence of one or more workstation printer control codes. For more information about the 3270 data stream, refer to IBM 3270 Information Display Data Stream Programmer’s Reference.