SIGN

Specifies the default convention for signs in signed numeric DISPLAY data items.

Syntax:

>>-.---.--SIGN--"convention"---------------><
   +-/-+

Parameters:

convention

For included signs, the sign storage convention must be one of:

  • ASCII
  • MF (identical to ASCII)
  • EBCDIC
  • IBM (identical to EBCDIC)
  • acu
  • mbp
  • ncr
  • realia
  • vax

or, for the default sign mode:

  • INCLUDED
  • TRAILING
  • SEPARATE
  • TRAILING-SEPARATE
  • LEADING
  • LEADING-SEPARATE

See Comments for more details.

Properties:

Default: SIGN"ASCII" and SIGN"TRAILING"
Phase: Syntax check
$SET: Initial

Dependencies:

CHARSET"ASCII" sets SIGN"ASCII" immediately.

CHARSET"EBCDIC" sets SIGN"EBCDIC" immediately.

DIALECT"RM" sets SIGN"EBCDIC" and SIGN"TRAILING" immediately.

Comments:

The convention parameter options have the following meanings:

ASCII, MF
The Micro Focus storage convention.
EBCDIC, IBM
The IBM storage convention. It is compatible with IBM COBOL, RM/COBOL-85, and the X/Open COBOL standard.

For JVM COBOL, SIGN"EBCDIC", along with one of HOST-NUMMOVE, HOST-NUMCOMPARE or SIGN-FIXUP is an invalid combination of directives, and is rejected during compilation. For native COBOL, the combination is permitted.

acu
The ACUCOBOL-GT storage convention. This convention is also compatible with data produced by RM/COBOL (not RM/COBOL-85) and previous versions of ACUCOBOL-GT.
mbp
The MBP COBOL sign storage convention.
Important: The MBP COBOL sign storage convention for USAGE DISPLAY directly conflicts with that used by IBM COBOL and some other COBOLs. As a result, signed USAGE DISPLAY items in the MBP format are correctly understood only when the program is compiled the mbp option. This is unlike the other sign conventions in which the run-time system can usually extract the correct value even when a mismatched sign convention is specified at compile time.
Restriction: MBP COBOL does not have the COMP-2 storage type.
ncr
This causes a different numeric format to be used. The format is the same as the one used when the EBCDIC or IBM option is used, except that positive COMP-3 items use x0B as the positive sign value instead of x0C. This option is compatible with NCR COBOL.
realia
The Realia sign storage convention. Sign information for S9(n) variables is stored using the conventions for Realia COBOL, and their conversion to binary decimal is the same as that performed by the Realia compiler.
vax
This creates numeric sign formats that are compatible with VAX COBOL. These are identical to the IBM formats, except that unsigned COMP-3 fields place x0C in the sign position instead of x0F.

The SIGN directive may be repeated to specify the sign storage convention for included signs and the default sign mode.

The sign modes INCLUDED and TRAILING both indicate a trailing included sign. The sign modes SEPARATE and TRAILING-SEPARATE indicate a trailing separate sign. The sign mode LEADING indicates a leading included sign. The sign mode LEADING-SEPARATE indicates a leading separate sign. The hyphen in the TRAILING-SEPARATE or LEADING-SEPARATE is optional.

If the hexadecimal value B is used as the internal sign representation, SIGN"ASCII" treats the data item as negative; some other COBOL systems (such as RM/COBOL) treat items represented this way as positive.

The default sign mode can be overridden by the NUMERIC SIGN clause in the special-names paragraph or the SIGN clause in a data description entry.