View previous topic :: View next topic
|
Author |
Message |
dgokulakrishnan
New User
Joined: 01 Jun 2011 Posts: 5 Location: Chennai
|
|
|
|
Dear Chaps,
I would like to Unload data from two different DB2 tables by using the UNLOAD TABLESPACE Utiltiy. Is there any way to JOIN two tables using the UNLOAD Utility?.
Tables are resides in two different Table Space. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
You can unload the data in 2 different files... then use sort to join them... |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Gokula,
In my current shop, they do this extensively using BMC Unload. Just check what is available at your place.
Thanks,
Sushanth |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Is it something that you wanted to do it only with UNLOAD utility??
I would suggest make use of DSNTIAUL rather UNLOAD utility because if your job fails inbetween while using UNLOAD then your table might lock the table which might be a problem |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
sushanth bobby wrote: |
Hi Gokula,
In my current shop, they do this extensively using BMC Unload. Just check what is available at your place.
Thanks,
Sushanth |
Hi Sushanth,
Even we have BMC installed in our shop...
How do we join two tables in different tablespaces in BMC? What is the option in BMC? |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Gylbharat,
Below is the skeleton, try it out.
Code: |
UNLOAD DIRECT NO
SELECT columns1,columns2
FROM TABLE1, TABLE2
WHERE Table1.z = Table2.z
WITH UR; |
DIRECT NO must be specified, which in the background uses DB2 Dynamic SQL to process the SELECT statement.
Thanks,
Sushanth |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Ok... Thanks sushanth...
Can you also give me a sample JCL? |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Gylbharat,
You shop has it means, you should be having the JCL, anyhow here is the sample
Code: |
//UNLOAD01 EXEC PGM=ADUUMAIN,REGION=0M,
// PARM=(DEDR,'ADUXM01','NEW ',,'MSGLEVEL(1)')
//*********************************************************************
// INCLUDE MEMBER=&BMCLIBR
//UTPRINT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=C
//SYSCNTL DD DUMMY
//SYSREC01 DD DSN=ADU.EXAMPLE1.SYSREC01,
// DISP=(,CATLG),SPACE=(TRK,(1,1)),UNIT=SYSDA
//SYSIN DD DD DISP=SHR,DSN=HLQ.TEST.JCL(BMCUL) |
Thanks,
Sushanth |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Thanks Sushanth.... |
|
Back to top |
|
|
|