• Re: Newbie Cobol85 problem - "** Error 189 ** 01 or 77 level dataitem

    From Shiggy Diggy@1:2320/100 to comp.lang.cobol on Thu Dec 1 06:39:09 2016
    From Newsgroup: comp.lang.cobol

    On Thursday, December 1, 2016 at 2:58:14 AM UTC-6, robert...@yahoo.com wrote:
    On Tue, 29 Nov 2016 14:16:09 -0800 (PST),

    Hi All,

    This is my first time posting and I'm very new to Cobol. I've been teaching
    myself Cobol85 for fun and as a rite of passage since June '16. I've written my
    first program using Fuji Cobol Compiler. I'm sure it's not the most graceful example of Cobol programming. :)

    The program works fine on my local desktop and my pretty report gets
    generated locally.

    However -- When I port the source to the Tandem, I get an error that appears
    to indicate an array (table) is too big..? As you can see below, the table rows
    are not high in bytes and it's less than 2000 rows table (array).

    I am compiling the code on "NonStop Himalaya System" mainframe.

    298 **************************
    299 * DEFINE Card Prefix TABLE
    300 **************************
    301 01 CARD-PRFX-TABLE.
    302 05 CARD-PRFX-TABLE-ROWS OCCURS 1943 TIMES
    303 DESCENDING KEY IS CARD-PRFX-NBR
    304 OF CARD-PRFX-TABLE
    305 INDEXED BY
    CARD-PRFX-TABLE-INDEX.
    306 10 CARD-PRFX-NBR PIC 9(11).
    307 10 INST-FIID PIC X(04).
    308 10 INST-NAME PIC X(35).
    309 10 INST-REGN PIC X(04).

    ** Error 189 ** 01 or 77 level data item too large for section:
    CARD-PRFX-TAB

    310 01 CARD-PRFX-TABLE-MAX-ROWS PIC S9(05) BINARY VALUE +1943.


    ...
    ...
    COBOL85 - T9257H01 - (15 MAR 09)
    No object file produced
    Number of compiler errors = 2
    Number of compiler warnings = 0
    Maximum symbol table size = 186530 bytes
    Last message on page 17
    Elapsed time - 00:00:00


    When I change the number of rows from 1943 to 100 (for example) in lines 302
    and 310 above, the program compiles on the Tandem without errors.

    Object file \CTD4S.$MDC016.CESVIC.RDFISSU
    TIMESTAMP 2016-11-29 00:09:00

    13 Code pages

    16 Primary data words
    5894 Secondary data words
    41 Data pages
    0 Resident code pages
    0 Extended data pages

    5910 Top of stack location in words
    1 Code segment

    0 Binder Warnings
    0 Binder Errors


    COBOL85 - T9257H01 - (15 MAR 09)
    The object file is executable on a NonStop Himalaya System
    Number of compiler errors = 0
    Number of compiler warnings = 0
    Maximum symbol table size = 186530 bytes
    Elapsed time - 00:00:01

    The manual I have is titled "HP COBOL Manual for TNS and TNS/R Programs"..
    It indicates the following regarding error 189:

    Cause. The size of a data item exceeds the maximum size permitted for the
    Data
    Division section in which it is defined.

    I'm pretty sure Cobol can handle more than a 2000 row array so I'm wondering
    if there is an environmental limitation I'm hitting?

    Sorry if my questions seems rudimentary, I'm definitely trying to review all
    available materials before asking a question.

    Thanks for your time!


    The limits are defined in the manual you referenced. Look in Chapter
    20, "HP COBOL Limits". The restrictions you're interested in are at
    the top of page 20-4.

    TNS is a rather odd environment, and programs are mostly limited to a
    small collection of relatively small "segments" (in this case, no
    single record ("01") can be bigger than 32767 bytes, which your table
    is). There are extensions, and a way to run "native" applications,
    that can get you around some of those.
    I did finally find the Cobol limits in there thanks! It's where I learned about
    the "Extended Storage" section. It looks like that section is available only on
    the TNS or TNS/R enabled compilers, which is a lucky coincidence for me.
    I probably could have ultimately searched the file for values instead of the array, but I just wanted to learn how to populate an array from a file.

    SEEN-BY: 154/30 2320/100 0 1 227/0