We're migrating from an old big-endian Solaris compiler (compiler version 5.1.4.0) to VC 9.0.0.59 (patch update 2) on little-endian Linux.
We're seeing an extra leading zero on fields defined as COMP.
This field:
03 ct-read pic 9(07) comp value 0.
will display as an 8 digit number (not 7 as defined) on Linux:
07754589
On Solaris, it would display as:
7754589
The field is displayed directly using a DISPLAY statement.
Compiler options for both platforms are:
NOBOUND NOALTER COMP NOCHECK NOCHECKDIV NOTRUNC OPT=3 FASTLINK NOANIM NOCOBIDY OPTSPEED
Changing NOTRUNC to TRUNC on Linux results in a completely different number being displayed (using the same static input files):
4531805
Removing both compiler directives COMP and NOTRUNC also removes the leading zero from the display on Linux:
7754589
As part of the migration, we would of course like the output of all of our programs to be the same on both platforms.
So some questions:
* Why is there now a leading zero in the display on Linux? Why does it disappear when COMP and NOTRUNC are not supplied?
* Are there performance or accuracy implications in removing those directives?
* Why does changing from NOTRUNC to TRUNC result in such a completely different number? The value would seem to very comfortably fit within the range of values supported by the picture.
Thanks in advance!