Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 Unload - using CDB utility

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
pshongal

New User


Joined: 14 Jun 2012
Posts: 70
Location: India

PostPosted: Tue Feb 09, 2016 1:07 pm    Post subject: DB2 Unload - using CDB utility
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: 1715
Location: UK

PostPosted: Tue Feb 09, 2016 2:07 pm    Post subject:
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: 70
Location: India

PostPosted: Tue Feb 09, 2016 2:15 pm    Post subject:
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: 70
Location: India

PostPosted: Wed Feb 10, 2016 1:44 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Best IMS DB Unload Utility jjabez10 IMS DB/DC 12 Thu Sep 22, 2016 11:15 pm
No new posts Any docs / links for isub- cobol comp... SRICOBSAS COBOL Programming 4 Fri Aug 26, 2016 2:35 pm
No new posts DB2 Unload format options Susanta DB2 2 Fri Aug 12, 2016 5:42 pm
No new posts Comparex utility to Syncsort conversion mistah kurtz SYNCSORT 11 Fri Jul 22, 2016 1:53 pm
No new posts DXT unload utility - DVRE0000 mistah kurtz DB2 1 Thu Jul 07, 2016 4:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us