CICS 3270 printers

Most of the additional format controls for printers that BMS provides are for a specific type of CICS® printer, the 3270 printer. A 3270 printer is any printer that accepts the 3270 data stream, it is the hardcopy equivalent of a 3270 display. It has a page buffer, corresponding to the display buffer of a 3270 display device.

See The 3270 buffer for an introductory discussion of the 3270 data stream.

A 3270 printer accepts two different types of formatting instructions: buffer control orders and print format orders. Buffer control orders are executed as they are received by the control unit, and they govern the way in which the buffer is filled. These are same orders that are used to format a 3270 display screen. We have already described some of the important ones in Orders in the data stream. For example, SBA (set buffer address) tells the control unit where in the buffer to place the data that follows, SF (start field), which signals an attributes byte and possibly field data, and so on. You can find a complete list in IBM 3270 Data Stream Programmers Reference.

In contrast, print format orders are not executed when they are received, but instead are stored in the buffer along with the data. These orders—NL (new line), FF (form feed), and so on—are interpreted only during a print operation, at which time they control the format of the printed output. They have no effect on displays, other than to occupy a buffer position; they look like blanks on the screen.

If you are writing to a 3270 printer, you can format with either buffer control orders or print format orders or a mixture of both. We show an example of formatting with buffer control orders in Outbound data stream example. If you send this same data stream to a 3270 printer, it prints an image of the screen shown in Figure 1. You might choose to format printed output with buffer control orders so that you can send the same data stream to a display and a printer.

On the other hand, you might choose to format with print format orders so that you can send the same stream to a 3270 printer and a non-3270 printer (print format orders are the same as the format controls on many non-3270 printers). See NLEOM option for more details about this choice.

Here is a data stream using print format orders that produces the same printed output as the data stream on Outbound data stream example, which uses buffer control orders.

Table 1. Example of data stream using print control orders
Bytes Contents Notes
1 X'FF' “Formfeed” (FF) order, to cause printer to space to a new page.
2-23 blanks 22 blanks to occupy columns 1-22 on first line.
24-33 Car Record Text to be printed, which appears in the next available columns (23-32) on line 1.
34 X'1515' Two successive “new line” (NL) orders, to position printer to beginning of third line.
35-80 Employee No: ______ Tag ________ State: __ Text to be printed, starting at first position of line 3.
81 X'19' “End-of-message” (EM) print order, which stops the printing.

Notice that the field structure is lost when you use print format orders. This does not matter ordinarily, because you do not use the printer for input. However, even if you format with print control orders, you might need to use buffer control orders as well, to assign attributes like color or underscoring to an area of text.