The 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


*

Syntax Rules

  1. The SIGN clause can 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.
  3. At most one SIGN clause can apply to any given numeric data description entry.

    ANS85 This rule is removed.

  4. If the CODE-SET clause is specified, any signed numeric data description entries associated with that file description entry must be described with the SIGN IS SEPARATE clause.

    MF This restriction is not enforced. See the topic The CODE-SET Clause.

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. 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". In this (default) case, General Rules 3 through 5 do not apply to such signed numeric data items. The representation of the default operational sign is defined in the topic Selection of Character Representation and Radix in the chapter Concepts of the COBOL Language.
  3. If the optional SEPARATE CHARACTER phrase is not present, then:
    1. The operational sign is presumed to be associated with the leading (or, respectively, trailing) digit position of the elementary numeric data item in a manner defined in the topic Selection of Character Representation and Radix in the chapter Concepts of the COBOL Language.
    2. 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).
  4. If the optional SEPARATE CHARACTER phrase is present, then:
    1. The operational sign is presumed to be the leading (or, respectively, trailing) character position of the elementary numeric data item; this character position is not a digit position.
    2. The letter "S" in a PICTURE character-string is counted in determining the size of the item (in terms of standard data format characters).
    3. The operational signs for positive and negative are the standard data format characters "+" and "-", respectively.
  5. 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.
  6. ANS85 If a SIGN clause is specified for an item (either an elementary numeric data description entry or a group item) which is subordinate to a group item for which a SIGN clause is also specified, then the SIGN clause specified in the subordinate item takes precedence.
  7. OSVSVSC2MF The SIGN clause is treated as documentary for external floating-point items. For internal floating-point items, the SIGN clause is invalid and will result in a diagnostic message.