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

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:

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