BMS also supports detectable fields, another special hardware feature available on some terminals. There are two hardware mechanisms for detectable fields: the "cursor select" key and the light pen. A terminal has either the key or a pen, not both. Both work the same way and, as the key succeeded the pen, we talk about the key.
For a field to be detectable, it must have certain field attributes, and the first character of the data, known as the designator character, must contain one of five particular values. You can have other display data after the designator character if you wish.
The bits in the field attributes byte that govern detectability also control brightness. High intensity (ATTRB=BRT) fields are detectable if the designator character is one of the detectable values. Normal intensity fields may or may not be detectable; you have to specify ATTRB=DET to make them so; nondisplay (ATTRB=DRK) fields cannot be detectable.
As usual, you can specify attributes and designator characters either in the map definition or by program override. However, DET has a special effect when it appears in an input-only map, as we explain in a moment.
Note that because high-intensity fields have, by definition, the correct field attributes for detectability, the terminal operator can make an unprotected high-intensity field detectable by keying a designator character into the first position of the field.
There are two types of detectable field, selection and attention fields; the type is governed by the designator character. A selection field is defined by a designator character of either a question mark (?) or a greater-than sign (>). The convention is that (?) means the operator has not selected whatever the field represents, and (>) means he has. The hardware is designed around this convention, but it is not enforced, and you can use another if it suits. You can initialize the designator to either value and initialize the modified data tag off or on with either value.
Every time the operator presses the cursor select key when the cursor is in a selection field, the designator switches from one value to the other (? changes to > and > changes to ?). The MDT is turned on when the designator goes from ? to > and off when the designator goes from > to ?, regardless of its previous state. This allows the operator to change his mind about a field he has selected (by pressing cursor select under it again) and gives him ultimate control over the status of the MDT. The MDT governs whether the field is included when transmission occurs, as it does for other fields. No transmission occurs at this time, however; selection fields do not of themselves cause transmission; that is the purpose of attention fields.
Attention fields are defined by a designator character of blank, null,10 or ampersand. In contrast to a selection field, when the cursor select key is pressed with the cursor in an attention field, transmission occurs.
If the designator character is an ampersand, the effect of pressing the cursor select key is the same as depressing the ENTER key. However, if the designator is blank or null, what gets transmitted is the address of every field with the MDT on, the position of the cursor, and an attention identifier of X'7E'. The contents of these fields are not transmitted, as they are with the ENTER key (or a cursor select with an ampersand designator). In either case, the fields with the MDT bit on may be selection fields or normal fields which the operator changed or which were sent with the MDT on.
After transmission caused by a cursor-select attention field with a blank or null designator, BMS tells you which fields were transmitted (that is, had the MDT on) by setting the first position of the corresponding input (I) subfield to X'FF'. The first position is otherwise set to X'00'. You can tell which attention field caused transmission from this value if it was the only one transmitted, or from the position of the cursor otherwise.
If transmission is caused by a cursor-select attention
field with an ampersand designator (or by the ENTER key or a PF key), the
I subfield contains the contents of the field if the MDT is on and the L subfield
reflects its length, as usual, except if the DET attribute is specified for
a field in the input map (that is MODE=IN or MODE=INOUT, DATA=FIELD). After a RECEIVE MAP naming such a map, this I subfield contains X'FF' with
a length of 1 if the field is selected (that is, if the MDT was on), and a
null (X'00') if not. BMS supplies no other input for the field, even
if some was transmitted.
Consequently, if you need to receive data from a detectable field
as well as knowing whether it was selected or not, you need to avoid the use
of DET in an input map. You can use separate maps for output and input and
specify the DET attribute only in the output map, or you can set the DET attribute
in the datastream sent by the program rather than in the map. For high intensity
fields you do not need to specify DET, because BRT implies DET. BMS will return
the data for fields specified as BRT in the input map.
You also need to ensure that the data gets transmitted. When the cause of transmission is the ENTER key, a PF key, or an attention field with an ampersand designator character, field data gets transmitted. It does not when the cause is an attention field with a blank or null designator.
See the IBM® 3270 Information Display System Data Stream Programmer’s Reference manual for more information about detectable fields.