Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
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
References
DavidatK

Senior Member


Joined: 22 Nov 2005
Posts: 715
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1