gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] difference with opencobol ans mf cobol


From: Sergey Kashyrin
Subject: Re: [open-cobol-list] difference with opencobol ans mf cobol
Date: Wed May 31 09:37:03 2006

David,

Yes, there are incompatibilities between MVS/zOS Cobol and OC even in more 
situations (especially intermediate result overflow etc).
The good question is do we need to follow MVS ?

                MOVE 'ab0' TO WK-NPA-1.
                MOVE WK-NPA-1 TO WK-NPA-2.
                DISPLAY 'WK-NPA-2=' WK-NPA-2.
                ADD 1 TO WK-NPA-2.
                DISPLAY 'WK-NPA-2=' WK-NPA-2.

z/OS:
WK-NPA-2=ab0
WK-NPA-2=121
OC:
WK-NPA-2=000
WK-NPA-2=001

At least converting '  0' to numeric 0 I think we are more on a safe side.

Even initialization in OC is different. Just put the first line
                DISPLAY 'WK-NPA-2=' WK-NPA-2.
and in z/OS you'll get "low values" and in OC "000"

Regards,
Sergey

----- Original Message ----- From: "David Korn" <address@hidden>
To: <address@hidden>
Sent: Wednesday, May 31, 2006 11:17 AM
Subject: [open-cobol-list] difference with opencobol ans mf cobol


Subject:  difference with opencobol ans mf cobol
--------

The following simple program gets different results with mvs cobol and
mf cobol emulating mvs.

Here is the program:
=============cut here=======================
      IDENTIFICATION DIVISION.
      PROGRAM-ID. PROG.
      ENVIRONMENT DIVISION.
      INPUT-OUTPUT SECTION.
      DATA DIVISION.
      WORKING-STORAGE SECTION.
        01 WK-NPA-1  PIC X(3) value '  0'.
        01 WK-NPA-2  PIC 9(3).
        01 WK-NPA-3  PIC X(3).
      PROCEDURE DIVISION.
                DISPLAY 'WK-NPA-1=' WK-NPA-1.
                MOVE WK-NPA-1 TO WK-NPA-2.
                DISPLAY 'WK-NPA-2=' WK-NPA-2.
                MOVE WK-NPA-2 TO WK-NPA-3.
                DISPLAY 'WK-NPA-3=' WK-NPA-3.
                STOP RUN.
=============cut here=======================

On MVS, the output is
WK-NPA-1=  0
WK-NPA-2=  0
WK-NPA-3=  0

With open-cobol, the output is
WK-NPA-1=  0
WK-NPA-2=000
WK-NPA-3=000


The problem appears to be in cob_move_alphanum_to_display() which
skips over white space.

David Korn
address@hidden


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list



reply via email to

[Prev in Thread] Current Thread [Next in Thread]