I´m new in COBOL, try to use the free Fujitsu Compiler Version V30L10, but I still have some problems with signed numerical datatypes.
It seems to be a bug of this compiler version.
1. On the declaration
77 VAR-1 PIC S9999.
77 DSPVAR PIC -ZZZZ9.
produce the statements
MOVE -123 TO VAR-1.
MOVE VAR-1 TO DSPVAR.
the compiler warning:
JMN3326I-W 'VAR-1' IS UNSIGNED NUMERIC ITEM OR NUMERIC EDITED ITEM WITHOUT EDITING SIGN CONTROL SYMBOLS IN MOVE STATEMENT. NEGATIVE VALUE CANNOT BE MOVED.
The variable DSPVAR obtains the value 120.
2. The declaration
77 VAR-1 PIC S9999 BINARY.
77 VAR-2 PIC S9999 BINARY.
77 VAR-3 PIC S99999 BINARY.
and the following statement
COMPUTE VAR-3 = VAR-1 + VAR-2
result in the error messages:
JMN2012I-S BINARY,COMPUTATIONAL,COMPUTATIONAL-3 OR PACKED-DECIMAL MUST BE SPECIFIED FOR NUMERIC ITEM.
JMN3151I-S OPERAND 'VAR-1' IN ARITHMETIC EXPRESSION MUST BE NUMERIC ITEM.
JMN3151I-S OPERAND 'VAR-2' IN ARITHMETIC EXPRESSION MUST BE NUMERIC ITEM.
I tried the datatypes COMP, COMP-3 etc too.
According to the delivered WINSVD debugger, the compiler handle the datatypes at the following way:
PIC 9999 External Decimal
PIC -Z9999 Numeric Edited.
PIC S9999 Numeric Edited (WHY ??!),
The declaration of PIC S9999 BINARY (or COMP resp. COMP-3) is generally not possible.
Is there any secret compiler option to work with signed numbers?
Has anybody some experiences with solving this problem,
or is this the serious bug of Fujitsu Compiler Ver.3 ?
It seems to be a bug of this compiler version.
1. On the declaration
77 VAR-1 PIC S9999.
77 DSPVAR PIC -ZZZZ9.
produce the statements
MOVE -123 TO VAR-1.
MOVE VAR-1 TO DSPVAR.
the compiler warning:
JMN3326I-W 'VAR-1' IS UNSIGNED NUMERIC ITEM OR NUMERIC EDITED ITEM WITHOUT EDITING SIGN CONTROL SYMBOLS IN MOVE STATEMENT. NEGATIVE VALUE CANNOT BE MOVED.
The variable DSPVAR obtains the value 120.
2. The declaration
77 VAR-1 PIC S9999 BINARY.
77 VAR-2 PIC S9999 BINARY.
77 VAR-3 PIC S99999 BINARY.
and the following statement
COMPUTE VAR-3 = VAR-1 + VAR-2
result in the error messages:
JMN2012I-S BINARY,COMPUTATIONAL,COMPUTATIONAL-3 OR PACKED-DECIMAL MUST BE SPECIFIED FOR NUMERIC ITEM.
JMN3151I-S OPERAND 'VAR-1' IN ARITHMETIC EXPRESSION MUST BE NUMERIC ITEM.
JMN3151I-S OPERAND 'VAR-2' IN ARITHMETIC EXPRESSION MUST BE NUMERIC ITEM.
I tried the datatypes COMP, COMP-3 etc too.
According to the delivered WINSVD debugger, the compiler handle the datatypes at the following way:
PIC 9999 External Decimal
PIC -Z9999 Numeric Edited.
PIC S9999 Numeric Edited (WHY ??!),
The declaration of PIC S9999 BINARY (or COMP resp. COMP-3) is generally not possible.
Is there any secret compiler option to work with signed numbers?
Has anybody some experiences with solving this problem,
or is this the serious bug of Fujitsu Compiler Ver.3 ?