IBM Support

PM55774: Loop terminates prematurely using MathLib.min()

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • For loop terminates prematurely when function mathLib.min() is
    used as
    the upper limit. The following code demonstrates the issue:
    
    function main()
     twelve decimal(3, 0) = 12;
     for (i decimal(3, 0) from 1 to mathLib.min(twelve, 20))
      SysLib.writeStdout(i);
     end
    end
    
    When this program is compiled to COBOL and run on iSeries its
    output is
    only two lines (i=1 and i=2) instead of expected twelve lines.
    When
    compiled to Java, the output is what is expected.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The temporary variable being created to hold the result of
    the min function was of insufficient size. This only
    occurred in the for loop logic.
    

Problem conclusion

  • The code has been modified to give the maximum allowable
    size for decimal and zoned temporary variables, when the
    length comes in as 0 (which is the case for system function
    without a length attribute).
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM55774

  • Reported component name

    RBD EGL FOR COB

  • Reported component ID

    5724S5001

  • Reported release

    751

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-01-11

  • Closed date

    2012-03-15

  • Last modified date

    2012-03-15

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

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

Fix information

  • Fixed component name

    RBD EGL FOR COB

  • Fixed component ID

    5724S5001

Applicable component levels

  • R751 PSN

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSMQ79","label":"Rational Business Developer"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.5.1","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
28 October 2021