gnucobol-users
[Top][All Lists]
Advanced

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

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


From: David Korn
Subject: [open-cobol-list] difference with opencobol ans mf cobol
Date: Wed May 31 08:18:02 2006

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


reply via email to

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