IBM Support

PI74933: SSRANGE COMPILE OPTION ENHANCEMENT: ADD NEW SUBOPTIONS MSG|ABD

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Adding new suboptions MSG or ABD to the existing compile option
    SSRANGE
    
    The message will allow a softer migration strategy.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of Enterprise COBOL V6.1 who use the   *
    *                 SSRANGE compiler option to generate code     *
    *                 that checks whether subscripts, including    *
    *                 ALL subscripts, or indexes attempt to        *
    *                 reference areas outside the region of their  *
    *                 associated tables, to ensure a smooth        *
    *                 migration from older COBOL compilers.        *
    *                                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION: SSRANGE can only find one problem per   *
    *                      run: Currently, when the SSRANGE code   *
    *                      detects the first subscript or index    *
    *                      out-of-range condition, it issues a     *
    *                      terminating error message and then      *
    *                      ABENDs. There is no way to detect       *
    *                      additional out-of-range problems,       *
    *                      without fixing the previous problem,    *
    *                      and submitting a new compile and run.   *
    *                      New function is needed.                 *
    *                                                              *
    ****************************************************************
    * RECOMMENDATION: Apply the provided PTF.                      *
    *                                                              *
    ****************************************************************
    IBM added the SSRANGE compiler option to help customers find
    subscripts, or indexes that attempt to reference areas outside
    the region of their associated tables.  This APAR will add the
    SSRANGE(MSG) compiler suboption, which will change SSRANGE
    checking to issue a non-terminating, warning-level runtime
    message which in turn allow COBOL to report on all subscript or
    index out-of-range conditions, in a single run of the
    application.
    

Problem conclusion

  • The new suboption, SSRANGE(MSG), will add new capabilities
    beyond what was originally provided by SSRANGE.
    
    
    1. Programming Guide -> Compiling and debugging your program ->
    Compiler Options -> SSRANGE
    
    SSRANGE
    
    
    Use SSRANGE to generate code that checks for out-of-range
    storage references.
    
    SSRANGE option syntax
    
            .-NOSSRANGE---------------------.
            |                               |
    >>------+-------------------------------+------------->
            |                               |
            |         .-NOZLEN-. .--ABD--.  |
            .-SSRANGE-+--------+-+-------+--.
                      '--ZLEN--' '--MSG--'
    
    Default is: NOSSRANGE
    
    Abbreviations are: SSR|NOSSR
    
    SSRANGE generates code that checks whether subscripts,
    including ALL subscripts, or indexes try to reference areas
    outside the region of their associated tables.  Each subscript
    or index is not individually checked for validity.  Instead,
    the effective address is checked to ensure that it does not
    reference data outside of the table.
    
    If you specify SSRANGE with no suboptions it will be accepted
    as a specification of SSRANGE(NOZLEN,ABD).
    
    Note:  If the SSRANGE option is in effect, range checks are
    generated by the compiler and the checks are always conducted at
    run time.  You cannot disable the compiled-in range checks at
    run time by specifying the runtime option CHECK(OFF).
    
    Variable-length items are also checked to ensure that
    references are within their maximum defined length.
    
    
    Reference modification expressions are checked to ensure that:
    
       1) The starting position is greater than or equal to 1.
    
       2) The starting position is not greater than the current
       length of the subject data item.
    
       3) The length value (if specified) is greater than or equal
       to one.
    
       4) The starting position and length value (if specified) do
       not reference an area beyond the end of the subject data
       item.
    
    The ZLEN and NOZLEN suboptions control how the compiler checks
    reference modification lengths:
    
       1) If ZLEN is in effect, the compiler generates code to
       ensure that reference modification lengths are greater than
       or equal to zero (that is, zero-length reference modification
       specifications will NOT get an SSRANGE error at runtime).
    
       2) If NOZLEN is in effect, the compiler generates code to
       ensure that reference modification lengths are greater than
       or equal to 1 (that is, zero-length reference modification
       specifications WILL get an SSRANGE error at runtime).  This
       is compatible with how SSRANGE behaved in previous COBOL
       versions.
    
    The MSG and ABD suboptions control the run time behavior of the
    COBOL program when a range check fails.
    
       1) If MSG is in effect and a range check fails, a runtime
       warning message will be issued and the program will continue
       executing and may potentially identify other out-of-range
       conditions.
    
       2) If ABD is in effect and a range check fails, the first
       out-of-range condition will result in a runtime error message
       and the program will abend.  In order to find other potential
       out of range conditions, the programmer would have to fix the
       first one, then recompile and run the program again, to find
       the next one.  This process may have to be repeated several
       times to identify all out of range conditions.
    
    
       For unbounded groups or their subordinate items, checking is
       done only for reference modification expressions.
       Subscripted or indexed references to tables subordinate to an
       unbounded group are not checked.
    
    2.Customization -> Enterprise COBOL compiler options -> SSRANGE
    
    SSRANGE
    
    
    SSRANGE affects whether code is generated to check for
    out-of-range storage references.
    
    Syntax
    
                         .-NO-------------.
    >>-SSRANGE=--+---+---+-NOZLEN-+-+-ABD-+--------><
                 '-*-'   '--ZLEN--' '-MSG-'
    
    Default
        SSRANGE=NO
    
        ZLEN|NOZLEN
           Generates code that checks subscripts, reference
           modifications, variable-length group ranges, and indexes
           at run time to ensure that they do not refer to storage
           outside the area assigned.  It also verifies that a table
           with ALL subscripting, specified as a function argument,
           contains at least one occurrence in the table.
    
           The generated code also checks that variable-length items
           do not exceed their defined maximum length as a result of
           incorrect setting of the OCCURS DEPENDING ON object.  For
           unbounded groups or their subordinate items, checking is
           done only for reference modification expressions.
           Subscripted or indexed references to tables subordinate
           to an unbounded group are not checked.
    
           The ZLEN and NOZLEN suboptions control how the compiler
           checks reference modification lengths:
    
               1) If ZLEN is in effect, the compiler generates code
               to ensure that reference modification lengths are
               greater than or equal to zero (that is, zero-length
               reference modification specifications will NOT get an
               SSRANGE error at runtime).
    
               2) If NOZLEN is in effect, the compiler generates
               code to ensure that reference modification lengths
               are greater than or equal to 1 (that is, zero-length
               reference modification specifications will get an
               SSRANGE error at runtime).  This is compatible with
               how SSRANGE behaved in previous COBOL versions.
    
    Performance consideration:  If anything other than SSRANGE=NO is
    in effect at compile-time, object code size is increased and
    there will be an increase in runtime overhead to accomplish the
    range checking.
    
        MSG|ABD
    
    
           The MSG and ABD suboptions control the run time behavior
           of the COBOL program when a range check fails.
    
               1) If MSG is in effect and a range check fails, a
               runtime warning message will be issued and the
               program will continue executing and may potentially
               identify other out-of-range conditions, if they
               exist.
    
               2) If ABD is in effect and a range check fails, the
               first out-of-range condition will result in a runtime
               error message and the program will abend.  In order
               to find other potential out of range conditions, the
               programmer would have to fix the first one, then
               recompile and run the program again to find the next
               one.  This process may have to be repeated multiple
               times to identify all out of range conditions.
    
       NO
    
           No code is generated to perform subscript or index
           checking at run time.
    
    Note:
    
       1) If you specify SSRANGE=ZLEN or SSRANGE=NOZLEN or anything
       other than SSRANGE=NO, range checks are generated by the
       compiler and the checks are always executed at run time.  The
       compiled-in range checks cannot be disabled even if you
       specify the Language Environment runtime option CHECK(OFF).
    
       2) The range-checking code can be used to aid in resolving
       any unexpected errors without recompilation.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI74933

  • Reported component name

    ENT COBOL FOR Z

  • Reported component ID

    5655EC600

  • Reported release

    610

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-01-13

  • Closed date

    2017-02-14

  • Last modified date

    2017-03-02

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Modules/Macros

  •    IGYCRCTL
    

Publications Referenced
SC27871400SC27871200   

Fix information

  • Fixed component name

    ENT COBOL FOR Z

  • Fixed component ID

    5655EC600

Applicable component levels

  • R610 PSY UI44685

       UP17/02/25 P F702

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS6SG3","label":"Enterprise COBOL for z\/OS"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.1","Edition":"","Line of Business":{"code":"LOB70","label":"Z TPS"}}]

Document Information

Modified date:
05 September 2024