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

Re: gnubol: A question



Not that this is definitive, but .....

>>> Michael McKernan <mck@tivoli.mv.com> 11/01/99 07:44PM >>>
<snip>
My question is really about abbreviated conditionals, apart from this
classic gotcha.  What effect do parenthesized expressions have on
abbreviation?  If I encounter the following

  IF a = b OR ( c < d AND e < f ) OR g
<snip>

Here's the compiler output:
==============
PAGE 0001         COBOL II/iX   HP31500A.04.19  [85]    TUE, NOV  2, 1999,  9:18 AM     Copyright Hewlett-Packard CO. 1987

 00001 COBCNTL  000100*  The following are defaults for Compatibility mode compiler.
 00002 COBCNTL  000200*CONTROL LIST,SOURCE,NOCODE,NOCROSSREF,ERRORS=100,NOVERBS,WARN
 00003 COBCNTL  000300*CONTROL LINES=60,NOMAP,MIXED,QUOTE=",NOSTDWARN,SYNC16,INDEX16
 00004 COBCNTL  000400*
 00005 COBCNTL  000500*  The following are defaults for Native compiler.
 00006 COBCNTL  000600*
 00007 COBCNTL  000700*CONTROL LIST,SOURCE,NOCODE,NOCROSSREF,ERRORS=100,NOVERBS,WARN
 00008 COBCNTL  000800*CONTROL LINES=60,NOMAP,MIXED,QUOTE=",NOSTDWARN,SYNC32,INDEX32
 00009 COBCNTL  000900*CONTROL NOVALIDATE,OPTIMIZE=0
 00010 COBCNTL  001000*
 00011 COBCNTL  001100*   For any other options, redirect COBCNTL.PUB.SYS by using
 00012 COBCNTL  001200*   a file equation.
 00013 COBCNTL  001300*
 00014          000700$CONTROL BOUNDS,CROSSREF,LIST,MAP,POST85,SOURCE,VERBS
 00016          001400*CONTROL DEBUG
 00017          002100$SET X4=ON

PAGE 0002/COBTEXT  COBOL           I D E N T I F I C A T I O N   D I V I S I O N
 00017          004900 IDENTIFICATION DIVISION.
 00018          005600 PROGRAM-ID. TEST.
 00019          006300 AUTHOR.  BPK.
 00020          007000 REMARKS. CREATION DATE   : 19991012.
 00021          007700******************************************************************
 00022          008400*****                                                        *****
 00023          008500*         This source has been edited on the PC using gvim.  See *
 00024          008600* http://www.vim.org for more information on this vi like editor *
 00025          008700* with syntax highlighting.                                      *
 00026          009100*         This program has been created to check Michael         *
 00027          009800* McKernan's question about conditional statements.  This test   *
 00028          010500* is being done on the HP 3000 MPE/iX platform.  The results     *
 00029          011200* should be applicable to COBOL in general.                      *
 00030          018900*****                                                        *****
 00031          019600******************************************************************

PAGE 0003/COBTEXT  TEST            E N V I R O N M E N T   D I V I S I O N
 00032          021000 ENVIRONMENT DIVISION.
 00033          021700 CONFIGURATION SECTION.
 00034          022400 SOURCE-COMPUTER.         HP-3000.
 00035          023100*SOURCE-COMPUTER.         HP-3000 WITH DEBUGGING MODE.
 00036          023800 OBJECT-COMPUTER.         HP-3000.

PAGE 0004/COBTEXT  TEST            D A T A   D I V I S I O N
 00037          035000 DATA DIVISION.

PAGE 0005/COBTEXT  TEST            W O R K I N G - S T O R A G E   S E C T I O N
 00038          040600 WORKING-STORAGE SECTION.
 00039          049700*
 00040          050400 77  WS-A                        PIC  X(01) VALUE "A".
 00041          051100 77  WS-B                        PIC  X(01) VALUE "B".
 00042          051800 77  WS-C                        PIC  X(01) VALUE "C".
 00043          052500 77  WS-D                        PIC  X(01) VALUE "D".
 00044          053200 77  WS-E                        PIC  X(01) VALUE "E".
 00045          053900 77  WS-F                        PIC  X(01) VALUE "F".
 00046          054600 77  WS-G                        PIC  X(01) VALUE "A".
 00047          054700     88  WS-H                        VALUE "A".

PAGE 0006/COBTEXT  TEST            P R O C E D U R E   D I V I S I O N
 00048          252700*~~~~~~~~~~~~~~~~~~~
 00049          253400 PROCEDURE DIVISION.
 00050          254100*~~~~~~~~~~~~~~~~~~~
 00051          257600*=======================
 00052          258300 00000-B-O-J SECTION 00.
 00053          259000*=======================
 00054          259700*
 00055          260400*------------
 00056          261100 00010-START.
 00057          261800*------------
 00058          262500*
 00059          263200     IF WS-A = WS-B OR (WS-C < WS-D AND WS-E < WS-F) OR WS-G
 00060          263900         DISPLAY "SEEMS TO PARSE OK?!?!?!?"
 00061          264600     END-IF.
 00062          264700     IF WS-A = WS-B OR (WS-C < WS-D AND WS-E < WS-F) OR WS-H
 00063          264800         DISPLAY "SEEMS TO PARSE OK?!?!?!?"
 00064          264900     END-IF.
 00065          265000     STOP RUN.

PAGE 0007/COBTEXT  TEST            SYMBOL TABLE MAP
 LINE# LVL SOURCE NAME                    BASE  OFFSET     SIZE   USAGE     CATEGORY R O J BZ


 WORKING-STORAGE SECTION

 00040 77  WS-A                           DP+        30         1 DISP      AN
 00041 77  WS-B                           DP+        34         1 DISP      AN
 00042 77  WS-C                           DP+        38         1 DISP      AN
 00043 77  WS-D                           DP+        3C         1 DISP      AN
 00044 77  WS-E                           DP+        40         1 DISP      AN
 00045 77  WS-F                           DP+        44         1 DISP      AN
 00046 77  WS-G                           DP+        48         1 DISP      AN
 00047 88   WS-H

PAGE 0008/COBTEXT  TEST            SYMBOL TABLE MAP
 LINE# LVL SOURCE NAME                    BASE  OFFSET     SIZE   USAGE     CATEGORY R O J BZ

 STORAGE LAYOUT               (#ENTRYS)

           FIRST TIME FLAG, etc.          DP+         8         4
           Global USE area                DP+        10         C
           RUN TIME $ . ,                 DP+        1C         4
           SORT/MERGE PLABEL              DP+        20         4
           TALLY                          DP+        28         4
           USER STORAGE                   DP+        28        21
           Literal pool ~    S$           CODE        0        30

PAGE 0009/COBTEXT  TEST            CROSS REFERENCE LISTING
                                         IDENTIFIERS
TALLY                              00000
WS-A                               00040   00059   00062
WS-B                               00041   00059   00062
WS-C                               00042   00059   00062
WS-D                               00043   00059   00062
WS-E                               00044   00059   00062
WS-F                               00045   00059   00062
WS-G                               00046   00059
WS-H                               00047   00062

PAGE 0010/COBTEXT  TEST            CROSS REFERENCE LISTING
                                         PROCEDURES and PROGRAMS
00000-B-O-J                        00052
00010-START                        00056
TEST                               00018

PAGE 0011/COBTEXT  TEST            STATEMENT OFFSETS
                                   Entry = test
     STMT   OFFSET   STMT   OFFSET   STMT   OFFSET   STMT   OFFSET   ...

       52       3C     59       40     61       A0     63       D8     65      10C
       56       40     60       74     62       A4     64      104

PAGE 0012/COBTEXT  TEST            COBOL ERRORS and WARNINGS
COBOL ERRORS:

LINE #   SEQ #  COL  ERROR  SEV   TEXT OF MESSAGE
------  ------  ---  -----  ---   ---------------

 00059  263200  63    365    Q    ILLEGAL RELATIONAL COMPARE.

0 ERROR(s), 1 QUESTIONABLE, 0 WARNING(s)

    DATA AREA IS       44 BYTES.
    CPU TIME = 0:00:00.  WALL TIME = 0:00:00.

NOTE: it does give a syntax error.

--
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.