IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

DB2 Unload - using CDB utility


 
IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Tue Feb 09, 2016 1:07 pm
Reply with quote

Hi All,

I am trying to unload records from multiple tables (join) using CDB utility. Below is the query.

Code:
UNLD  DATA   FORMAT(DSN)                                   
MODE DIRECT                                               
SELECT  T1.C_TRANS_ID                             
       ,T1.C_SOURCE_CD                             
       ,T2.C_SOURCE_NM                           
       ,T2.C_SOURCE_TX                           
       ,T1.A_TYPE_CD                                 
       ,T4.A_TYPE_NM                                 
       ,T4.A_TYPE_TX                                 
       ,T1.A_TYPE_SEQ_NO                             
       ,T1.MO_PRTN_KEY                                 
       ,T1.UPD_SOURCE_CD                               
       ,T3.C_SOURCE_NM                           
       ,T3.C_SOURCE_TX                           
       ,T1.A_DT                                       
       ,T1.A_TM                                       
       ,T1.CREATE_TS                                   
       ,T1.A_RSN_CD                                   
       ,T1.A_RSN_CMNT_TX                             
       ,COALESCE(T5.A_CRIT_IN,SPACE(003))             
       ,COALESCE(T5.A_RSN_DS_TX,SPACE(254))           
 FROM TABLE VMUSIU.C_SRCE     T2                 
           ,VMUSIU.C_SRCE     T3                 
           ,VMUSIU.ACT_TYP    T4                   
           ,VMUSIU.E_C_ACT    T1 LEFT OUTER JOIN   
            VMUSIU.ACT_RSN    T5                   
       ON ( T5.A_RSN_CD  = T1.A_RSN_CD )               
 WHERE                                                           
 (                                                               
          T1.MO_PRTN_KEY IN (39,38,37,36)                     
  AND     T1.C_SOURCE_CD = T2.C_SOURCE_CD       
  AND     T1.UPD_SOURCE_CD   = T3.C_SOURCE_CD       
  AND     T1.A_TYPE_CD      = T1.A_TYPE_CD             
  AND     T1.CREATE_TS   BETWEEN '2016-02-08-16.00.00.000001' 
                             AND   '2016-02-08-20.00.00.000000'   
  AND     T1.A_TYPE_CD     <>  450                           
 )                                                               
 WITH UR


Job is failing with below error.
Code:

23:40:40.37 MAIN.COMWRKMD NGTB293 CDBWORK NAME(DEFAULT) WAS NOT FOUND.         
23:40:40.83 MAIN.SVRMS000 NGTC258 CDB SUBSYSTEM IS ACTIVE. VERSION 05.01.       
23:40:40.97 MAIN.SVRRESTR NGTZ197 STATUS FILE IS EMPTY.  UNABLE TO RESTART.     
23:40:40.99 MAIN.COMOBRPT NGTZ343 OBJECT REPORT DID NOT FIND ANY STATUS RECORDS.
                                                                               
23:40:41.00 MAIN.RRGMINIT NGTR303 UTILITY COMPLETE, COMPLETION CODE=8.         


Is the UNLD keyword is correct for joins also?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2431
Location: Hampshire, UK

PostPosted: Tue Feb 09, 2016 2:07 pm
Reply with quote

What does the manual say?
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Tue Feb 09, 2016 2:15 pm
Reply with quote

Manual says as below.

Code:
A single table can be specified via the table variable in the UNLD statement.
Joins are also supported by way of new keywords.


But I could not find other keywords.
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Wed Feb 10, 2016 1:44 pm
Reply with quote

I could run the query with below change in MODE.

Code:
UNLD  DATA   FORMAT(DSN)                                   
MODE DB2SQL


Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts Unload Report in ARCHIVE from CA-Disp... CA Products 0
No new posts Convert a packed decimal value to zon... DB2 6
No new posts Issue in KWIKKEY utility while creat... JCL & VSAM 2
No new posts DSLIST utility ISRDSLST line command CLIST & REXX 5

Back to Top