COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only
  • 1.  COBOL trapping Error when program not found in SET addr to ENTRY statement

    Posted Tue May 18, 2021 12:22 PM
    Hi

    I am tasked with converting some Assembler programs to Enterprise COBOL. One such Assembler program has a table with program names,
    and the the program does a LOAD with ERRRET for each program in the table and handles the 'not found' error.  The table will be used by
    another program.

    I have written a replacement COBOL program SPSINIT, which performs the load of each program in the table using the following ENTRY  statement 

    IF WS-VCON-TAB-PGM-ADDR(WS-VCON-TAB-NDX) EQUAL NULL
       SET WS-VCON-TAB-PGM-ADDR(WS-VCON-TAB-NDX) TO ENTRY
       WS-VCON-TAB-PGM-ID(WS-VCON-TAB-NDX)   

    However if the ENTRY program is not found, the  SPSINIT program abends with S806.

    I need to be able to trap this error in the SPSINIT program and perform some other action.

    Thanks

    Ron







    ------------------------------
    Ron Mascarenhas
    ------------------------------


  • 2.  RE: COBOL trapping Error when program not found in SET addr to ENTRY statement

    Posted Tue May 25, 2021 07:49 AM
    Hi Ron,

    You need to handle the serious error (eg. CEE3501S The module BOGUS was not found.) with an LE condition handler that resets the resume cursor position.

    This can be modeled on the example https://www.ibm.com/docs/en/zos/2.4.0?topic=pli-cobol-examples-using-ceehdlr-ceegtst-ceeczst-ceemrcr

    Bernie

    ------------------------------
    Bernie Rataj
    Senior Software Developer
    IBM Canada Ltd.
    Canada
    https://www.ibm.com/marketplace/ibm-compilers
    ------------------------------



  • 3.  RE: COBOL trapping Error when program not found in SET addr to ENTRY statement

    Posted Tue June 01, 2021 02:27 PM
    Thanks Bernie. I have used the LE handler before so I will follow your suggestion.
    I wish there was another way to handle such errors, similar to  the ON EXCEPTION on the CALL

    Ron

    ------------------------------
    Ron Mascarenhas
    ------------------------------