Lieutenant Commander
Lieutenant Commander

Less than comparison operator Issue in Visual COBOL

In Visual COBOL for eclipse we are facing the below issue

IF (Variable-1 < 0) OR
(Variable-2 < 0) OR
(Variable-3 < 0)

The PIC clause and value for the 3 variables are as below.

Variable-1 (S9(005)V99)- 0000000+
Variable-2 (S9(005)V99)- 0000000+
Variable-3 (S9(005)V9(6)) - 00000000000+

The above condition is set to true but actually, it is not.

When we try SIGN-FIXUP compiler option it is working fine. Whether any other alternate solution is there for this issue?




1 Reply
Micro Focus Expert
Micro Focus Expert

I tested this here using Visual COBOL for Eclipse 5.0 in a native Windows project and the test results were false so I could not reproduce your reported behavior.

Can you please tell me what product version and under which operating system you are testing?

What other directives are you using?

Should these be specified as COMP or COMP-3?

If you copy this code into a test program by itself without any other additional directives does it still fail?


The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.