IBM Support

PH52051: QUERY USING LISTAGG FUNCTION MAY ISSUE SQLCODE -137 DESPITE THAT PROPER LENGTH WAS PROVIDED ON INPUT.

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When string with length equal to 4000 is provided as input to
    LISTAGG function, SQLCODE -137 may be issued incorrectly.
    Db2 code will be modified to respect the null byte of input
    string and avoid SQLCODE -137 to be issued.
    
    ADDITIONAL SYMPTOMS:
    LISTAGG INCORROUT DB2INCORR/K SQLINCORR SQLINCORROUT
    

Local fix

  • BYPASS/CIRCUMVENTION:
    Use CAST to input higher length for LISTAGG function.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All Db2 12 for z/OS users of  the LISTAGG                    *
    * built-in function.                                           *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * The LISTAGG function may issue an                            *
    * SQLCODE -137 when the result length                          *
    * equals exactly the described length or                       *
    * default length.                                              *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Apply corrective PTF when available                          *
    ****************************************************************
    The LISTAGG function may issue an SQLCODE -137 when the result
    length equals exactly the described length or default length.
    When the string with length equal to 4000 is provided on input
    to the LISTAGG function, an SQLCODE -137 may be issued
    incorrectly.  The problem is that Db2 needs to include the null
    byte in its calculation to avoid this issue when the result
    equals the maximum length defined.  If the user modifies the
    length to 12000 bytes, this same problem would occur if the
    result string is exactly 12000 bytes.
    

Problem conclusion

  • Db2 has been modified to correct this problem to make sure it
    includes the null byte in its calculation.
    Additional keywords: LISTAGG INCORROUT DB2INCORR/K
                         SQLINCORR SQLINCORROUT
    

Temporary fix

Comments

APAR Information

  • APAR number

    PH52051

  • Reported component name

    DB2 OS/390 & Z/

  • Reported component ID

    5740XYR00

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2023-01-20

  • Closed date

    2023-02-16

  • Last modified date

    2023-03-01

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

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

Modules/Macros

  • DSNXSTSG DSNXSOLA DSNXSTSD DSNXSING DSNXSMRG DSNXSOPC DSNXSTGS
    DSNXSILA DSNXSIND DSNXSMRD DSNXSMGS DSNXSIGS DSNXSIFG DSNXSORM
    DSNXSRME DSNXSMIG
    

Fix information

  • Fixed component name

    DB2 OS/390 & Z/

  • Fixed component ID

    5740XYR00

Applicable component levels

  • RC10 PSY UI90584

       UP23/02/25 P F302

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":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEPEK","label":"DB2 for z\/OS"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.0","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
01 March 2023