The next several sections tell you how to format outbound data to express the attributes, position, and contents of a field. You need to know this information if you are writing to a 3270 using terminal control commands. If you are using BMS, all this is done for you, and you can move on to Input from a 3270 terminal.
When you define a field in the 3270 data stream, you begin with a start field (SF) or a start field extended (SFE) order. Orders are instructions to the 3270. They tell it how to load its buffer. They are one byte long and usually are followed by data in a format specific to the order.
The SF order is supported on all models and lets you specify the field attributes and the display contents of a field, but not extended attributes. To define a field with SF, you insert a sequence in the data stream as in Figure 85.
If you need to specify extended attributes, and your terminal supports them, you use the start field extended order instead. SFE requires a different format, because of the more complex attribute information. Extended attributes are expressed as byte pairs. The first byte is a code indicating which type of attribute is being defined, and the second byte is the value for that attribute. The field attributes are treated collectively as an additional attribute type and also expressed as a byte pair. Immediately after the SFE order, you give a 1-byte count of the attribute pairs, then the attribute pairs, and finally the display data. The whole sequence is shown in Figure 86.
When a field is on the screen, you can change it with a command almost identical in format to SFE, called modify field (MF). The only differences from SFE are:
For example, to change the "menu" field of earlier examples back to the default color for the terminal and underscore it, you would need the sequence in Figure 87.
The SF and SFE orders place the field they define at the current position in the buffer, and MF modifies the field at this position. Unless the field follows the last character sent (that is, begins in the current buffer position), you need to precede these orders with a set buffer address (SBA) order to indicate where you want to place or change a field. To do this, you send an SBA order followed by a 2-byte address, as in Figure 88.
The address in the figure is a "12-bit" address for position 112 (X'70'), which is row 2, column 33 on an 80-column screen. Note that counting starts in the first row and column (the zero position) and proceeds along the rows. There are two other addressing schemes used: "14-bit" and "16-bit". Buffer positions are numbered sequentially in all of them, but in 12- and 14-bit addressing, not all the bits in the address are used, so that they do not appear sequential. (The X'70' (B'1110000') in the figure appears as B'110000' in the low-order six bits of the rightmost byte of the address and B'000001' in the low-order six bits of the left byte.) The IBM® 3270 Information Display System Data Stream Programmer’s Reference manual explains how to form addresses.
After an SF, SFE, or MF order, the current buffer address points to the first position in the buffer you did not fill--right after your data, if any, or after the field attributes byte if none.
To set the attributes of a single character position, you use a set attribute (SA) order for each attribute you want to specify. For example, to make a character blink, you need the sequence in Figure 89.
The attributes you specify with SA orders are assigned to the current buffer position, in the same way that field definitions are placed at the current buffer position, so you generally need to precede your SAs with SBA sequences.
[[ Contents Previous Page | Next Page Index ]]