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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Need a JCL to extract the data from the DB2 tables...
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    Post subject: Reply to: Need a JCL to extract the data from the DB2 tables
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: 1439
Location: Bangalore,India

PostPosted: Mon Aug 18, 2008 11:21 am    Post subject:
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-

http://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    Post subject: Reply to: Need a JCL to extract the data from the DB2 tables
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    Post subject:
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    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Mon Aug 18, 2008 11:53 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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