Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6970
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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
No new posts How to Extract BMS Marco Source from ... Howard Hinman CICS 5 Tue Oct 31, 2017 11:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us