A fix is available
APAR status
Closed as program error.
Error description
ABEND04E RC00E70005 in DSNXGRM1 M290
Local fix
n/a
Problem summary
**************************************************************** * USERS AFFECTED: All DB2 10 and DB2 11 for z/OS users of the * * MERGE statement with REOPT(ONCE or ALWAYS). * **************************************************************** * PROBLEM DESCRIPTION: An internal ABEND04E rc00E70005 can * * occur at DSNXGRM1 M290 for SQL * * that contains a MERGE statement, host * * variables, NOT ATOMIC CONTINUE ON * * SQLEXCEPTION, and REOPT bind options. * **************************************************************** * RECOMMENDATION: * **************************************************************** An internal ABEND04E rc00E70005 can occur at location DSNXGRM1 M290 when executing SQL that contains a MERGE statement, host variables, a special register, a NOT ATOMIC CONTINUE ON SQLEXCEPTION statement, and REOPT bind options for the host variables. Since the abend is not externalized, it is visible via an EREP report and if present, it is likely the reoptimization of the host variables did not take place. The following example helps to illustrate a failing case. Step 1. Create a Table TAB1 and View V1 as follows. CREATE TABLE TAB1 (K1 INT, F1 INT, D1 DATE); CREATE VIEW V1 AS SELECT K1, F1 FROM TAB1 WHERE D1 = CURRENT DATE; Step 2. Populate the table with two rows. INSERT INTO TAB1 VALUES(1,1,CURRENT DATE); INSERT INTO TAB1 VALUES(2,1,CURRENT DATE); Step 3. Prepare the MERGE statement. EXEC SQL PREPARE S1 FROM 'MERGE INTO V1 T1 USING ( VALUES ( ?, ? ) ) AS T2(F1, K1) ON ( T1.K1 = T2.K1) WHEN MATCHED THEN UPDATE SET F1 = T2.F1 WHEN NOT MATCHED THEN INSERT(K1,F1) VALUES(T2.K1, T2.F1) NOT ATOMIC CONTINUE ON SQLEXCEPTION'; Step 4. Bind the package with REOPT. BIND PACKAGE(STLEC1.PKGSAMP) VALIDATE(RUN) ACTION(REP) - REOPT(VARS) MEMBER(MEMSAMP) RELEASE(COMMIT) Step 5 . Execute the package and prepared SQL. The results should be as expected but if the internal abend occurs, it is likely that the reoptimization of the host variables did not occur. Please note that a similar internal abend, an ABEND04E at DSNXGRM1 M291, can occur for a MERGE statement that references a SEQUENCE. An example for this case is as follows: EXEC SQL PREPARE S1 FROM 'MERGE INTO a.rdtv1 AS X USING ( VALUES( (nextval for BB.rds2), (SELECT AVG(B) FROM A.RDT WHERE C BETWEEN ? AND 1000) ) FOR 4 ROWS ) AS T ( B , C ) ON ( X.B = 3 or X.B = 1) WHEN MATCHED THEN UPDATE SET (X.B, X.C) = ( smallint (((nextval for sysadm.pds1 + 500 + nextval for "pds2" + prevval for b.rds1) * .75)), T.C) WHEN NOT MATCHED THEN INSERT (B, C) values(nextval for sysadm.pds1 - nextval for "pds2" + prevval for b.rds1, T.B) NOT ATOMIC CONTINUE ON SQLEXCEPTION';
Problem conclusion
The code in DB2 is modified to honor the REOPT options if a special register is included for a MERGE statement to prevent the internal abends. Additional Keywords: SQLMERGE SQLSPECIALREG SQLREOPTVARS SQLHOSTVAR SQLREOPTONCE SQLREOPT SQLSEQUENCE
Temporary fix
Comments
APAR Information
APAR number
PI56108
Reported component name
DB2 OS/390 & Z/
Reported component ID
5740XYR00
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2016-01-27
Closed date
2016-03-14
Last modified date
2016-04-05
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
UI36183 UI36184
Modules/Macros
DSNXGRM1
Fix information
Fixed component name
DB2 OS/390 & Z/
Fixed component ID
5740XYR00
Applicable component levels
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"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"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":"11.0","Edition":"","Line of Business":{"code":"","label":""}}]
Document Information
Modified date:
05 April 2016