View previous topic :: View next topic
|
Author |
Message |
ibmmainframesyntel
Active User
Joined: 26 Feb 2007 Posts: 126 Location: Chennai
|
|
|
|
Hi ,
I have to extract only the primary key of th DB2 table into flat file.
Using that extracted primary key,have to extract two more fields from another table in the flat file.
Is that possible thr JCL?
Example
Table - E.ECCCPRT
Code: |
I_part
-------
001
002
.
.
.
100
|
Table - E.ESPMAST
Code: |
I_part VOLUME_Demand part_Cost
------- ------------------- ------------
001 1 1
002 2 2
.
.
.
100 4 4
.
.
.
900 2 2
[ |
Output file
Code: |
_part VOLUME_Demand part_Cost
------- ------------------- ------------
001 1 1
002 2 2
.
.
.
100 4 4
|
Note ,input is Two DB2 tables...need the output in flat file..
We can code this thr cobol-db2 program,but if i got this thr JCl,will be best..
Thanks in advance |
|
Back to top |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
If I under stood your requirement try this
Code: |
//Jobcard
//******************************
//* UNLOAD DEVELOPER DB2 TABLES
//*--------------------------------------
//*
//UNLD01 EXEC DB@IAUL,SQLPARM=SQL
//SYSPUNCH DD DUMMY
//SYSREC00 DD DSN=O/p-datasetname,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(50,50),RLSE),
// UNIT=SYSDA
//SYSIN DD *
Select A.I_part ,A.VOLUME_Demand ,A.part_Cost
from E.ESPMAST A
Join E.ECCCPRT c
where A.I_PART= C.I_PART
|
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
Back to top |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
Quote: |
Dont you thing provided proc is a site specific one?
|
Ya verymuch the provided proc is a site specific one.
But every shop will have a specific proc corresponding to one which one which I provided for unloading the tables to a dataset.
I just provided a hint for table unloading |
|
Back to top |
|
|
ibmmainframesyntel
Active User
Joined: 26 Feb 2007 Posts: 126 Location: Chennai
|
|
|
|
S...I got it.....thank u..........
The jcl which i used is
Code: |
//STEP010 EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(GRT1)
RUN PROGRAM(DSNTIAUL) -
PLAN(DSNTIAUL) -
LIB('DB2P.RUNLIB.LOAD') -
PARM('SQL')
END
/*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSREC00 DD DSN=T9308US.ESPMAST.UNLOAD.IPART,
// UNIT=PROD,
// DISP=(,CATLG,DELETE),DATACLAS=FBLRG,
// LRECL=20
//SYSPUNCH DD DUMMY
//SYSIN DD *
SELECT A.I_PART,A.C_PART_STAT FROM E.ESPMAST A,
E.EPRTMST B
WHERE A.I_PART= B.I_PART
WITH UR;
/*
//
|
Thank u........... |
|
Back to top |
|
|
ibmmainframesyntel
Active User
Joined: 26 Feb 2007 Posts: 126 Location: Chennai
|
|
|
|
the above JCl is specific for our Mainframe,I thinkl so..
I got the above jcl with by one of my project mate... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
ibmmainframesyntel,
exxxxccccceeeeeelllllllllaaaaaannnnnnntt.
your initiative has earn you a positive, helpful answer from me in the future for any question you raise. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
DSNTIAUL is an IBM program, shipped with DB2. It is well documented in the fine manual.
O. |
|
Back to top |
|
|
|