Unable to get the SQL extracted using DCOPY in "ISQL Online SQL Execution"

book

Article ID: 143050

calendar_today

Updated On:

Products

CA Database Analyzer for DB2 for z/OS CA Fast Unload for DB2 for z/OS CA Fast Check for DB2 for z/OS CA Fast Index for DB2 for z/OS CA Fast Load for DB2 for z/OS CA Rapid Reorg for DB2 for z/OS CA Database Management for DB2 for z/OS - Utilities Suite

Issue/Introduction

The DBA was unable to get the SQL extracted using DCOPY command in  ISQL Online SQL Execution, SQL Editor. 

IQPSQLE1 --- (CAPS ON)  --- SQL Editor --- (NULLS ON)  --- 2020/01/14 07:47:57
COMMAND ===> DCOPY 'RAUJO02.DB2.JCL(MEMBER1)'                 SCROLL ===> CSR 
                                                                               
Edit the SQL statements that you wish to test below.  When you are done        
 editing the SQL, hit PF3/15 or enter 'END' to return to the RC/SQL control    
 panel.   Host variables will be parsed out, so that you may test your SQL     
 repeatedly with various host values.                                          
                                                                               
a__                                                                            
___ SELECT * FROM SYSIBM.SYSTABLES                                             
___   WHERE NAME = 'SYSCOPY' ;                                                 
b__                                                                            
******************************* BOTTOM OF DATA ********************************

And you get the result: 

IQPSQLE1 --- (CAPS ON)  --- SQL Editor --- (NULLS ON)  --- 2020/01/14 07:48:58
COMMAND ===>                                                  SCROLL ===> CSR 
                                                                               
Edit the SQL statements that you wish to test below.  When you are done        
 editing the SQL, hit PF3/15 or enter 'END' to return to the RC/SQL control    
 panel.   Host variables will be parsed out, so that you may test your SQL     
 repeatedly with various host values.                                          
                                                                               
___                                                                            
___                                                                            
___ SELECT * FROM SYSIBM.SYSTABLES                                             
___   WHERE NAME = 'SYSCOPY' ;                                                 
___                                                                            
******************************* BOTTOM OF DATA ********************************

PT508I: DCOPY command processed successfully.                

Note a blank line was added just before the SELECT statement because of the A in line command, but the SQL statement was not copied over and MEMBER1 was empty. 

 

Environment

Release : 20.0

Component : Interactive SQL

Resolution

To work with SQL Editor and copy/move data to/from a data set or member you have three commands available.

DCOPY - Copy a member of a PDS or a sequential dataset
DCREATE - Create a new member of a PDS
DREPLACE - Replace a member of a PDS or a sequential dataset

The DCOPY command will copy a member of a PDS or a sequential data set to the SQL Editor, so only A (after) and B (before) are allowed in the line command.

To copy the SELECT statement to a PDS member you have to work with DCREATE or DREPLACE commands, with these commands you can work with an "M", "C", a set of "MM" or "CC" in the line command to get the expected results.