Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 78
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: 1931
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: 78
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: 78
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 NULLFILE on ICEGENER Utility Ashishpanpaliya DFSORT/ICETOOL 5 Wed Nov 08, 2017 10:45 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts How to Use DebugTool CodeCoverage Uti... neo4u IBM Tools 0 Thu Jun 22, 2017 6:38 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts DB2 - TERMINATE utility vasanthz DB2 5 Mon May 15, 2017 11:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us