IBM Support

SQLCODE -512 while executing REXX code in DB2 V7, and SQLCODE -30071 going from V7 to V6

Question & Answer


Question

A REXX executable that worked before the upgrade to V7, is getting an SQLCODE -512: Error SQL statement - PREPARE S1 FROM :sqlstmt1 Another problem, after migration to V7, is that, when trying to access data on V6 server, the executable fails with SQLCODE -30071

Answer

SQLCODE512 R710 <-> R710 on PREPARE with host variable:
Using DBPROTOCOL(PRIVATE) REXX gets SQLCODE512 when connecting 
between two DB2 R710. After REBIND with DRDA it works 
between R710 <-> R710. 
Check the DBPROTOCOL BIND option that you used for the packages or plans involved. If it is PRIVATE, then REBIND with DBPROTOCOL(DRDA).

The rebind of DBPROTOCOL from PRIVATE to DRDA , on both of the V7 subsystems, allows the connection to complete successfully, however the user is still unable to go from the V7 system, where DRDA has been rebound, to a V6 system. The error is SQLCODE -30071

The second problem is described in PMR 53386,032,724: Ability to use REXX Language Support between DB2 subsystems at different versions.

This error occurs because PREPARE with ATTRIBUTE is not supported on Version 6. In order to support the scrollable cursor, the CURSORS declarations had been changed in V7, and the CURSOR attribute is not specified until later with PREPARE w/ATTRIBUTE. The precompiler also had been fixed to mark the DBRM to be release dependent.

The suggested workaround, on page 33 of the PMR, is to use V6 DSNREXX for V7 DB2® subsystem until all of the subsystems can be brought to V7:

Copy the DSNREXX load module and its three aliases to a library that is ahead in the search order (STEPLIB, JOBLIB, and so forth) in the job:

DSN610.SDSNLOAD(DSNREXX)      
DSN610.SDSNLOAD(RXSUBCOM)                                                      
DSN610.SDSNLOAD(SQLDBS)                                                        
DSN610.SDSNLOAD(SQLEXEC)          


Then rerun DSNTIJRX to rebind the V6 DSNREXX packages on V7.

 //********************************************************
 //* JOB NAME = DSNTIJRX                                               *        
 //*                                                                   *        
 .....                                                                          
 //********************************************************
 //JOBLIB   DD  DISP=SHR,    
 //             DSN=DSN710.SDSNLOAD 
 //DSNTIJR1 EXEC PGM=IKJEFT01,DYNAMNBR=20                                       
 //SYSTSPRT DD  SYSOUT=*                                                        
 //SYSPRINT DD  SYSOUT=*                                                        
 //SYSUDUMP DD  SYSOUT=*                                                        
 //SYSTSIN  DD  *                                                               
 DSN SYSTEM(V71A)                                                               
 BIND PACKAGE(DSNREXX) MEMBER(DSNREXX)  ACTION(REPLACE) ISOLATION(CS)-          
 LIBRARY('DSN610.SDSNDBRM') VALIDATE(BIND) -                                    
 CURRENTDATA(NO)                                                                
 BIND PACKAGE(DSNREXUR) MEMBER(DSNREXX) ACTION(REPLACE) ISOLATION(UR)-          
 LIBRARY('DSN610.SDSNDBRM') VALIDATE(BIND)                                      
 BIND PACKAGE(DSNREXCS) MEMBER(DSNREXX) ACTION(REPLACE) ISOLATION(CS)-          
 LIBRARY('DSN610.SDSNDBRM') VALIDATE(BIND) CURRENTDATA(NO)
 BIND PACKAGE(DSNREXRS) MEMBER(DSNREXX) ACTION(REPLACE) ISOLATION(RS)-  
 LIBRARY('DSN610.SDSNDBRM') VALIDATE(BIND)
 BIND PACKAGE(DSNREXRR) MEMBER(DSNREXX) ACTION(REPLACE) ISOLATION(RR)-                        
 LIBRARY('DSN610.SDSNDBRM') VALIDATE(BIND)                                      
 BIND PLAN(DSNREXX) -                                                           
 PKLIST(*.DSNREXX.DSNREXX, -                                                    
 *.DSNREXUR.DSNREXX, -                                                          
 *.DSNREXCS.DSNREXX, -                                                          
 *.DSNREXRS.DSNREXX, -                                                          
 *.DSNREXRR.DSNREXX) -                                                          
 ACT(REP) ISO(CS) SQLRULES(DB2)                                                 
 RUN PROGRAM(DSNTIAD)  PLAN(DSNTIA71) -                                         
 LIBRARY('USER.TESTLIB')                                                        
 END                                                                            
 //SYSIN    DD  *                                                               
 GRANT EXECUTE ON PACKAGE DSNREXX.DSNREXX   TO PUBLIC; 
 GRANT EXECUTE ON PACKAGE DSNREXUR.DSNREXX  TO PUBLIC; 
 GRANT EXECUTE ON PACKAGE DSNREXCS.DSNREXX  TO PUBLIC; 
 GRANT EXECUTE ON PACKAGE DSNREXRS.DSNREXX  TO PUBLIC; 
 GRANT EXECUTE ON PACKAGE DSNREXRR.DSNREXX  TO PUBLIC;                          
 GRANT EXECUTE ON PLAN    DSNREXX           TO PUBLIC;                          
 // 

The reference to remote objects in V6 should now work successfully.

[{"Product":{"code":"SSEPEK","label":"Db2 for z\/OS"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"DB2 Rexx","Platform":[{"code":"PF025","label":"Platform Independent"},{"code":"PF035","label":"z\/OS"}],"Version":"6.0;7.0;8.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21216053