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 with join

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

New User


Joined: 31 Aug 2005
Posts: 2
Location: Buenos Aires - Argentina

PostPosted: Tue Dec 06, 2005 6:44 pm    Post subject: DB2 Unload with join
Reply with quote

Inside a JCL, how can I do a Join of 2 tables in a unload to a file ? is it possible ?
Like this:
SELECT myTable01.campo1,
myTable01.campo2,
myTable02.campo1,
myTable02.campo2,
from myTable01, myTable02
Thanks, Ezequiel
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Dec 06, 2005 9:12 pm    Post subject: Re: DB2 Unload with join
Reply with quote

Hi Zapi2003

Have you actually tried this? I do this all the time without problems. icon_smile.gif

If you're experiencing problems, give us the exact JCL/SQL you're using.
Back to top
View user's profile Send private message
zapi2003

New User


Joined: 31 Aug 2005
Posts: 2
Location: Buenos Aires - Argentina

PostPosted: Wed Dec 07, 2005 12:56 am    Post subject:
Reply with quote

DavidatK:
Thanks for your answer ! The job is this:

//PASO05 EXEC DSNTIAUL,COND=(4,LT)
//STEPLIB DD DSN=DSN710.RUNLIB.LOAD,DISP=SHR
// DD DSN=DSN710.SDSNLOAD,DISP=SHR
//SYSREC00 DD DSN=CCALD.S.C1BA1058.F051206,UNIT=SYSDA,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(50,285),RLSE),
// DCB=(RECFM=FB,LRECL=34,BLKSIZE=0)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIB71) PARM('SQL') -
LIB('DSN710.RUNLIB.LOAD')
//SYSPUNCH DD DUMMY
//SYSIN DD *
SELECT CLE_COD_CLI_CD,
CUE_COD_CTA_CD,
CUE_COD_EST_CD,
CLE_COD_CPT_PAG_CD,
CLE_COD_SGM_CLI_CD,
CLE_COD_SBG_CLI_CD,
CUE_COD_SGM_CTA_CD,
CUE_COD_SBG_CTA_CD,
CUE_COD_NAT_CTA_CD
FROM ATISUSDA.CCCLTEMT,
ATISUSDA.CCCUENDV;
/*

the error message is the following:

IKJ56644I NO VALID TSO USERID, DEFAULT USER ATTRIBUTES USED
READY
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIB71) PARM('SQL') LIB('DSN710.RUNLIB.LOAD
IKJ56712I INVALID KEYWORD, PLAN(DSNTIB71)
IKJ56712I INVALID KEYWORD, PARM('SQL')
READY
END
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 unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am


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