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

gnubol: IBM flags nested conditionals as error (RC=8) but recovers OK



Here it is (compilations only). To me this means it is not an extension but good
error recovery. Note in the second listing, the not size error binds to the inner
add.

Tim Josling

IBM COBOL for MVS & VM   1.2.2

     NOFLAGSTD

0  000001                IDENTIFICATION DIVISION.
   000002                PROGRAM-ID. COBOL-TEST.
   000003                DATA DIVISION.
   000004                WORKING-STORAGE SECTION.
   000005                01  W   PIC
9.
BLW=0000+000         1C
   000006                01  X   PIC
9.
BLW=0000+008         1C
   000007                01  Y   PIC
9.
BLW=0000+010         1C
   000008                01  Z   PIC
9.
BLW=0000+018         1C
   000009
   000010                PROCEDURE DIVISION.
   000011                001.
   000012                    MOVE 8 TO X
Z                                                          6 8
   000013                    MOVE 9 TO W
Y                                                          5 7
   000014
   000015                    ADD 1 TO
W                                                             5
   000016                       SIZE ERROR
   000017      1                DISPLAY "OVERFLOW ON W"
   000018
   000019      1                ADD 1 TO
X                                                          6
   000020      1                   SIZE ERROR
   000021      2                   DISPLAY "OOPS - UNEXPECTED RESULT"
   000022
   000023      1                   NOT SIZE ERROR
   000024      2                   DISPLAY "NO OVERFLOW ON X"
   000025
   000026      2                   ADD 1 TO
Y                                                       7
   000027      2                      SIZE ERROR
   000028      3                      DISPLAY "OVERFLOW ON Y"
   000029
   000030      3                      ADD 1 TO
Z                                                    8
   000031      3                          SIZE ERROR
   000032      4                          DISPLAY "OOPS - UNEXPECTED RESULT"
   000033
   000034      3                          NOT SIZE ERROR
   000035      4                          DISPLAY "NO OVERFLOW ON Z"
   000036      4                          DISPLAY "RIGHT ASSOCIATION IS
SUFFICIENT"
   000037
   000038      2                      NOT SIZE ERROR
   000039      3                      DISPLAY "OOPS - UNEXPECTED RESULT"
   000040
   000041                       NOT SIZE ERROR
   000042      1                DISPLAY "OOPS - UNEXPECTED RESULT"
   000043
   000044                    END-ADD
   000045
   000046                .


     19  IGYPS2112-E   The "ADD" verb did not have a matching scope terminator.
A scope terminator was inserted on line 41.  The
                       execution results may not be correct.

                       Same message on line:     26

     30  IGYPS2112-E   The "ADD" verb did not have a matching scope terminator.
A scope terminator was inserted on line 38.  The
                       execution results may not be correct.

-Messages    Total    Informational    Warning    Error    Severe    Terminating
0Printed:       5                          1         4
0Return code 8

     NOFLAGSTD
   LineID  PL SL
----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+----7-³--+----8
Map and Cross Reference
0  000001                identification division.
   000002                program-id. test1.
   000003                data division.
   000004                working-storage section.
   000005                01  a pic 9 value
9.                                                       BLW=0000+000         1C
   000006                01  b pic 9 value
9.                                                       BLW=0000+008         1C
   000007                procedure division.
   000008                p1.
   000009                    add 1 to
a                                                             5
   000010                       size error
   000011      1                   display 'size error 1'
   000012      1                   add 1 to
b                                                       6
   000013      1                not size error
   000014      2                   display "not size error 2"
   000015      2             .
   000016                    display "end program".
   000017                    exit program.
   000018

     12  IGYPS2112-E   The "ADD" verb did not have a matching scope terminator.
A scope terminator was inserted on line 16.  The
                       execution results may not be correct.
-Messages    Total    Informational    Warning    Error    Severe    Terminating
0Printed:       1                                    1
0Return code 8




--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.