A fix is available
APAR status
Closed as program error.
Error description
Although the Language Reference Manual (LRM) states that "The [...] RETURNING data item is an output-only parameter. On entry to the called program, the initial state of the PROCEDURE DIVISION RETURNING data item has an undefined and unpredictable value. You must initialize the PROCEDURE DIVISION RETURNING data item in the called program[.] The value that is passed back to the calling program is the final value of the PROCEDURE DIVISION RETURNING data item when the called program returns." prior COBOL implementations did initialize fullword (pic s9(9) comp-5, for example) or smaller values to zero on entry to the program.
Local fix
Initialize the RETURNING value in the compile unit returning it, as suggested by the LRM.
Problem summary
**************************************************************** * USERS AFFECTED: Users of Enterprise COBOL V5.2 using CALL * * ... RETURNING data-name, where the * * data-name is a 3 or 4 byte signed binary * * data item, a POINTER or USAGE OBJECT * * REFERENCE. This includes users who are * * recompiling RDz generated XML converter * * programs. RDz has corrected their usage of * * RETURNING data items, but previously * * generated programs could still have a * * problem. * * * * * **************************************************************** * PROBLEM DESCRIPTION: Incorrect output: The COBOL Language * * Reference manual states the following: * * "The CALL ... RETURNING data item is * * an output-only parameter. On entry to * * the called program, the initial state * * of the PROCEDURE DIVISION RETURNING * * data item has an undefined and * * unpredictable value. You must * * initialize the PROCEDURE DIVISION * * RETURNING data item in the called * * program before you reference its * * value. The value that is passed back * * to the calling program is the final * * value of the PROCEDURE DIVISION * * RETURNING data item when the called * * program returns." It happens that * * previous COBOL compilers (COBOL V4.2 * * and earlier) were setting the * * returning temporary to binary zero if * * the returning parameter was a short * * binary. That means less than or equal * * to four bytes long. Some existing * * COBOL V4.2 (and earlier) applications * * were relying on unsupported behavior * * related to CALL ... RETURNING * * statement. The behavior is the * * following: * * If the called program does not set * * the returning parameter but the * * calling program still expects the * * returning parameter to be set to zero. * * These applications will behave * * differently under COBOL V5.2 because * * the returning parameter is not set to * * anything by default. The returning * * parameter has to be set explicitly by * * the user. * * * * CIRCUMVENTION * * Set the returning parameter in the call * * XML converters with the corrected RDz p * * * **************************************************************** * RECOMMENDATION: Apply the provided PTF. * **************************************************************** If an application is passing a returning parameter to a called program and the called program does not set the returning parameter explicitly, then in COBOL V5.2 the parameter will have undefined and unpredictable value.
Problem conclusion
To ease migration from previous COBOL versions (COBOL V4.2 and earlier) to COBOL V5.2, the COBOL V5.2 compiler was modified to replicate the previous COBOL compiler implementations.
Temporary fix
Comments
APAR Information
APAR number
PI59493
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
2016-03-21
Closed date
2016-05-27
Last modified date
2016-07-04
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Modules/Macros
IGYCRCTL
Fix information
Fixed component name
ENT COBOL FOR Z
Fixed component ID
5655W3200
Applicable component levels
R520 PSY UI38258
UP16/06/02 P F606
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:
04 July 2016