UNLOCK (Unlock) Keyword for Display Files

Use this record-level keyword to specify that the OS/400 program is to unlock the keyboard immediately after issuing an input operation to the record format you are defining. Without the UNLOCK keyword, the OS/400 program leaves the keyboard locked after reading the data on the display. The work station user cannot key data into input-capable fields while the data that has just been read is being processed.

The format of the keyword is:

UNLOCK[(*ERASE) | (*MDTOFF)] | [(*ERASE *MDTOFF)] |  [(*MDTOFF *ERASE)]

The parameter values *ERASE and *MDTOFF are optional. If you do not specify any parameter value, *ERASE is the default.

When your program sends an input operation, the following sequence of operations usually occurs:

  1. The keyboard is unlocked (if it is not already unlocked) to allow the work station user to key into input-capable fields on the display.
  2. The work station user presses the Enter key (or a valid function key).
  3. Modified data tags (MDTs) for input-capable fields in the record format are set on if they have been keyed into or if they were displayed with the DSPATR(MDT) keyword in effect.
  4. When the input operation is completed, the parameter values for UNLOCK affect the input-capable fields with MDTs set on as described in the following sections.