Command Reference 5-77
SUB
Purpose Subtracts the contents of one field from the contents of another.
Syntax SUB
buffer-field1
,
buffer-field2
[
,
[
invalid label
] [
, valid label
] ]
Process The SUB command subtracts the contents of
buffer-field1
from the contents of
buffer-field2
, inserting the result into
buffer-field2
.
The
buffer-field
fields can be one the following:
Buffer-field1
and
2
Description
INPUT Input Buffer
Logical Field Name
(TEMP1)
Temporary Buffer
Field
Logical Field Name (LU1) Lookup Buffer Field
Logical Field Name (PR1) Printer Buffer Field
Logical Field Name
(Field1) [Index]
Array Buffer Field
Buffer-field1
only:
Number
Number prefixed by a
number sign (#)
Rule: Only numeric fields are allowed.
Optional Fields
Invalid
and
valid labels
are discussed in "Script Flow" at the beginning of this
chapter. The exception is as follows:
If
buffer-field2
becomes negative and
invalid label
is defined, control passes to that
label.
Example
This example subtracts the contents of CONTROL_ID from TEMP1. Then, control
passes to the next line.
SUB CONTROL_ID,TEMP1
See Also
ADD
DEC
INC
MULTIPLY
DIVIDE