SIGN clause
The SIGN clause specifies the position and the mode of representation of the operational sign when it is necessary to describe these properties explicitly.
General format
[ SIGN IS ] {LEADING } [ SEPARATE CHARACTER ] {TRAILING} |
Syntax rules
1. The SIGN clause may be specified only for a numeric data description entry whose PICTURE contains the character 'S', or a group item containing at least one such numeric data description entry.
2. The numeric data description entries to which the SIGN clause applies must be described, implicitly or explicitly, as USAGE IS DISPLAY.
General rules
1. The optional SIGN clause, if present, specifies the position and the mode of representation of the operational sign for the numeric data description entry to which it applies, or for each numeric data description entry subordinate to the group to which it applies. The SIGN clause applies only to numeric data description entries whose PICTURE contains the character 'S'; the 'S' indicates the presence of, but neither the representation nor, necessarily, the position of the operational sign.
2. If a SIGN clause is specified in a group item subordinate to a group item for which a SIGN clause is specified, the SIGN clause specified in the subordinate group item takes precedence for that subordinate group item.
3. If a SIGN clause is specified in an elementary numeric data description entry subordinate to a group item for which a SIGN clause is specified, the SIGN clause specified in the subordinate elementary numeric data description entry takes precedence for that elementary numeric data item.
4. A numeric data description entry whose PICTURE contains the character 'S', but to which no optional SIGN clause applies, has an operational sign, but neither the representation, nor, necessarily, the position of the operational sign is specified by the character 'S'. General rules 5 through 7 do not apply to such signed numeric data items.
5. If the optional SEPARATE CHARACTER phrase is not present, then:
a. The operational sign will be presumed to be associated with the leading (or, respectively, trailing) digit position of the elementary numeric data item.
b. The letter 'S' in a PICTURE character-string is not counted in determining the size of the item (in terms of standard data format characters).
6. If the optional SEPARATE CHARACTER phrase is present, then:
a. The operational sign will be presumed to be the leading (or, respectively, trailing) character position of the elementary numeric data item; this character position is not a digit position.
b. The letter 'S' in a PICTURE character-string is counted in determining the size of the item (in terms of standard data format characters).
c. The operational signs for positive and negative are the standard data format characters '+' and '-', respectively.
7. Every numeric data description entry whose PICTURE contains the character 'S' is a signed numeric data description entry. If a SIGN clause applies to such an entry and conversion is necessary for purposes of computation or comparisons, conversion takes place automatically.