IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need a JCL to extract the data from the DB2 tables...


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Mon Aug 18, 2008 10:47 am
Reply with quote

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
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Mon Aug 18, 2008 11:06 am
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Aug 18, 2008 11:21 am
Reply with quote

Prasanth,

Quote:
//UNLD01 EXEC DB@IAUL,SQLPARM=SQL

Dont you thing provided proc is a site specific one?

Go thru 2007 post-

ibmmainframes.com/about24248.html
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Mon Aug 18, 2008 11:29 am
Reply with quote

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
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Mon Aug 18, 2008 11:43 am
Reply with quote

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
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Mon Aug 18, 2008 11:45 am
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 18, 2008 11:50 am
Reply with quote

ibmmainframesyntel,

exxxxccccceeeeeelllllllllaaaaaannnnnnntt.

your initiative has earn you a positive, helpful answer from me in the future for any question you raise.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Aug 18, 2008 11:53 am
Reply with quote

DSNTIAUL is an IBM program, shipped with DB2. It is well documented in the fine manual.

O.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top