IBM Support

PM30653: for loop does not complete expected iterations

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • User has a for loop as follows:
    for(count from 1 to StrLib.characterLen(StrLib.clip(tempData))
    by 1)
    ...
    
    
    tempData is a String variable with a number ? 1 of non-blank
    characters,
    and does not chage in the body of the loop.
    
    At runtime, the loop iterates only once.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The problem was that the temporary variables used by part of
    the FOR statement (this is not the case for other parts of
    the FOR statement) were being placed in the statement level
    temporary variable memory area, instead of the function
    level. The statement level area are only around for a
    statement, and the next statement would redefine them and
    overlay the values. The function level area is available for
    the entire function instead. The problem was that the for
    statement can contain other statements within it, and if any
    of those happened to use statement level variables, then it
    overlaid the value that the for statement was expecting to
    keep around.
    

Problem conclusion

  • The solution was to place the TO part of the FOR statement's
    temporary variables at the function level instead, thus
    preserving the value.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM30653

  • 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

    2011-01-17

  • Closed date

    2011-05-06

  • Last modified date

    2011-05-06

  • 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"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.5.1","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
06 May 2011