IBM Support

PH15975: INCORRECT INSPECT RESULT WITH BEFORE AND AFTER WHEN INSPECT REPLACING USED.

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Issue when using INSPECT REPLACING statement along with BEFORE
    and AFTER clause.
    
    Simple code :
    
    ==============================================================
    
    01 VAR A     PIC X(100) VALUE
         'EMP NAME=LAST,FIRST EMP NAME2=null'
    
    INSPECT VAR A REPLACING ALL ',' BY '--'
    BEFORE INITIAL ', EMP NAME2='
    AFTER INITIAL 'EMP NAME=
    
    ==============================================================
    Code resulted incorrect output :
    
    ==============================================================
    String After : 'EMP NAME=LAST--FIRST--EMP NAME2=null'
    ==============================================================
    
    The correct output should be :
    
    ==============================================================
    String After : 'EMP NAME=LAST--FIRST, EMP NAME2=null'
    ==============================================================
    
    INSPECT clause behaves as if BEFORE clause were ignored.
    

Local fix

  • No
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of Enterprise COBOL V5 and later       *
    *                 releases running programs which use          *
    *                 INSPECT with REPLACING, BEFORE, and AFTER    *
    *                 phrases.                                     *
    *                                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION: The INSPECT statement with REPLACING,   *
    *                      BEFORE, and AFTER phrases produced      *
    *                      incorrect result.                       *
    ****************************************************************
    * RECOMMENDATION: Apply the provided PTF.                      *
    *                                                              *
    ****************************************************************
    Due to a logic error in determining the position range specified
    by BEFORE and AFTER phrases, the INSPECT statement replaced a
    data item beyond the specified positions.
    
    COB0501T/K COB0502T/K COB0601T/K COB0602T/K COB0603T/K
    

Problem conclusion

  • The INSPECT processing in the COBOL Runtime has been corrected
    to replace characters only within the character positions
    specified by the BEFORE and AFTER phrases.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PH15975

  • Reported component name

    ENT COBOL FOR Z

  • Reported component ID

    5655EC600

  • Reported release

    7A0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-08-22

  • Closed date

    2019-10-18

  • Last modified date

    2019-11-01

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

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

    UI66040

Modules/Macros

  • IGZCER4  IGZCEV4  IGZCMGEN IGZCMGUE IGZLLIBV IGZXAPI  IGZXCDA
    IGZXD24  IGZXDMR  IGZXLPIO IGZXLPKA IGZXLPKB IGZXLPKC IGZXLPKD
    IGZXLPKE IGZXLPKF IGZXLPKG IGZXPK2
    

Fix information

  • Fixed component name

    LE ENT COBOL LI

  • Fixed component ID

    568819812

Applicable component levels

  • R7A0 PSY UI66040

       UP19/10/30 P F910

  • R7B0 PSY UI65941

       UP19/10/30 P F910

  • R7C0 PSY UI65943

       UP19/10/30 P F910

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":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS6SG3","label":"Enterprise COBOL for z\/OS"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7A0","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
12 December 2023