Example: set switch off

The following example shows how you can set a switch off by coding a MOVE statement that moves the condition name value to the conditional variable.

For example, you can use a data item called SWITCH-OFF to set an on-off switch to off, as in the following code, which resets a switch to indicate that end-of-file has not been reached:


01  Switches
    05  Transaction-EOF-Switch       Pic X  Value space.
        88  Transaction-EOF                 Value "y".
01  SWITCH-OFF                       Pic X  Value "n".
. . . 
Procedure Division.
    . . .
    Move SWITCH-OFF to Transaction-EOF-Switch