Menu

CBL_READ_FILE with -debug

Anonymous
2020-11-30
2020-12-11
  • Anonymous

    Anonymous - 2020-11-30

    I install GnuCOBOL 4 (r3990)

    Compile with -debug and run abort

    libcob: :499: error: OCCURS DEPENDING ON 'l' out of bounds: 0
    note: minimum subscript for 'FILLER 3': 1
    
     Last statement of  was at line 499 of
    call  'CBL_READ_FILE'  using  f  r2  r3  r4  t2(l + 1 : )
    

    I read first part of file xi (f) into buffer t2 of open file xo. l count the bytes and for first part 0 are in the buffer.

    Compile without -debug run.

    Changing to following compile with -debug run

    add  1  to  l
    call  'CBL_READ_FILE'  using  f  r2  r3  r4  t2(l : )
    add  -1  to  l
    

    I install GnuCOBOL 3.1.1 (r3989)

    Compile with -debug and run abort

    libcob: :499: Fehler: OCCURS DEPENDING ON »l« außerhalb des gültigen Bereichs: 0
    note: minimum subscript for 'FILLER 3': 1
    
     Last statement of  was at line 499 of
    

    With above changing it runs.

     

    Last edit: Simon Sobisch 2020-11-30
  • Simon Sobisch

    Simon Sobisch - 2020-11-30

    Something is very strange as the module name is missing?!? I guess it was removed instead of replaced, by "prog" correct?

    In any case if l is zero that the out-of-bounds is correct.

     
  • Anonymous

    Anonymous - 2020-11-30

    Yes, the module name and directory was removed because of the length. „l“ was always 0. Thank you for the fast reply.

     
    • Simon Sobisch

      Simon Sobisch - 2020-11-30

      When L was always zero the ringtone checks you activate with --debug is completely correct.
      What did you expect to happen in any case with a zero position?

       
  • Anonymous

    Anonymous - 2020-12-04

    On mainframe are varible length files with mixing binary and ebcdic fields. After binary download i get the files.
    My program reads r3 bytes to position l + 1 (here is l equal 0) adds r3 to l. After analysing the data a new r3 is calculated and the next part will be read. Finally the record is witten with length l.
    So this program is not important and run with add 1 and -1 to l. This program run years with -debug.
    Finally run the important programs and a pre test on linux is desirable and have no quirks length. I feel better that this programs has no problems.
    For testing i use -debug and this should be equivalent to enterprise cobol. The new installed cobol is more better for verification of index and subscripts than the one month old version.

     
    • Simon Sobisch

      Simon Sobisch - 2020-12-04

      For testing i use -debug and this should be equivalent to enterprise cobol.

      No. Because enterprise cobol does not do every possible check against COBOL standard rules. You have to tell it to do so (which degrades performance and improves portability and predictability plus possibly catches coding errors (which is the reason that is good to activate this at least during development). But you possibly meant exactly that.

      The new installed cobol is more better for verification of index and subscripts than the one month old version.

      Yes, especially because it actually checks those in conditions, too.

      I'm a bit confused now - If you are the thread starter (posting anonymously leads to some confusion from time to time [and needs manual moderation]): is your initial issue "solved" now?

       
  • Anonymous

    Anonymous - 2020-12-11

    Anonymous is one person. I test always with -debug and enterprise cobol with ssrange. The initial issue is „solved“ and it is now a christmas gift.

     

Anonymous
Anonymous

Add attachments
Cancel