Controlling the Data Keys

Like most other keys on the keyboard, it is possible to disable data keys or make them act like function keys, that is, terminate the ACCEPT operation. To do this, use the following call:

call x"AF" using    set-bit-pairs
                    data-key-control 

where set-bit-pairs and data-key-control are defined in the Working-Storage Section of your program as follows:

 01 set-bit-pairs               pic 9(2) comp-x value 1.
 01 data-key-control.
    03 data-key-setting         pic 9(2) comp-x.
    03                          pic x value "3".
    03 first-data-key           pic x.
    03 number-of-data-keys      pic 9(2) comp-x.

The fields in data-key-control should be set up as follows:

data-key-setting
Defines the action of the keys affected, as follows:
0
The key is disabled. If it is pressed during an ACCEPT operation, the bell is rung and the key rejected.
1
The key acts as a function key. It terminatesthe ACCEPT operation.
2
The character is simply entered into thefield. This is the default.
first-data-key
The first character to be affected.
number-of-data-keys
The number of characters to be affected.