A fix is available
APAR status
Closed as program error.
Error description
When compiling with OPT(1) or OPT(2), consecutive INSPECT REPLACE statements may result in incorrect output if the BEFORE or AFTER clause is specified. For example: INSPECT field1 REPLACING ALL 'Z' BY 'B' INSPECT field1 REPLACING ALL 'X' BY 'B' AFTER INITIAL 'B'
Local fix
Use OPT(0)
Problem summary
**************************************************************** * USERS AFFECTED: Users of Enterprise COBOL V5.2 compiling * * and running programs using the OPT(1|2) * * compiler option, where the programs contain * * two consecutive INSPECT REPLACING * * statements that inspect the same data item, * * where the new characters in the first * * INSPECT statement appear in a BEFORE or * * AFTER clause of the second INSPECT * * statement. * * * **************************************************************** * PROBLEM DESCRIPTION: Incorrect output at runtime: The first * * INSPECT REPLACING statement does not * * change the INSPECTed data item, * * causing the second INSPECT statement * * to produce an incorrect result. * * * **************************************************************** * RECOMMENDATION: Apply the provided PTF. * * * **************************************************************** The compiler was attempting to group the two INSPECT REPLACING statements into one, which is incorrect when a BEFORE or AFTER clause is used.
Problem conclusion
The compiler was fixed to no longer combine consecutive INSPECT REPLACING statements if one has a BEFORE or AFTER clause.
Temporary fix
Comments
APAR Information
APAR number
PI77995
Reported component name
ENT COBOL FOR Z
Reported component ID
5655W3200
Reported release
520
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2017-03-10
Closed date
2017-03-22
Last modified date
2017-04-03
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Modules/Macros
IGYCBE IGYECWI IGYMSGE IGYMSGK IGYMSGT
Fix information
Fixed component name
ENT COBOL FOR Z
Fixed component ID
5655W3200
Applicable component levels
R520 PSY UI45765
UP17/03/31 P F703
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"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"520","Edition":"","Line of Business":{"code":"LOB17","label":"Mainframe TPS"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"520","Edition":"","Line of Business":{"code":"","label":""}}]
Document Information
Modified date:
03 April 2017