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

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

book

Article ID: 143050

calendar_today

Updated On:

Products

Database Management for DB2 for z/OS - Administration 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)  --- yyyy/mm/dd hh:mm:ss
COMMAND ===> DCOPY 'AUTHID1.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 this result is received: 

IQPSQLE1 --- (CAPS ON)  --- SQL Editor --- (NULLS ON)  --- yyyy/mm/dd hh:mm:ss
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.             SYNTAX      : DCOPY {'datasetname(member)'}
DCREATE - Create a new member of a PDS.                                    SYNTAX      : DCREATE {'datasetname(member)'}
DREPLACE - Replace a member of a PDS or a sequential dataset. SYNTAX      : DREPLACE {'datasetname(member)'}

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.

The online help text for the DCOPY command describes the use of "A" and "B" ....

To use the command, you must specify where in the SQL Editor you
want the member imported using the A (After) or B (Before) line
command; then enter the DCOPY command in the command area and
press <Enter>.

Additional Information

SQL Editor Commands

While in the SQL Editor the "?" character will display a list of command and a "?" on each of these including DCOPY, DCREATE and DREPLACE have good online documentation explanations to read.