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
 

 

Is it possible to execute the DB2 query from batch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
nileshp

New User


Joined: 25 Feb 2006
Posts: 31

PostPosted: Thu Aug 02, 2007 10:31 am    Post subject: Is it possible to execute the DB2 query from batch
Reply with quote

Can anyone tell me is it possible to execute the DB2 query from batch?

Thanks & Regards
NIlesh Padwal
Back to top
View user's profile Send private message

saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Thu Aug 02, 2007 1:57 pm    Post subject:
Reply with quote

Hi Nilesh,
Yes you can execute a DB2 query from Batch.


Thanks
Sai
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Aug 02, 2007 2:11 pm    Post subject:
Reply with quote

Hi,

A sample JCL can be like:
Code:
//STEP030 EXEC PGM=IKJEFT01,                               
//             DYNAMNBR=20,                                 
//             REGION=4M                                   
//*                                                         
//STEPLIB  DD  DSN=DB2SYS1.VEND.LOADLIB,                   
//             DISP=SHR                                     
//*                                                         
//SYSREC00 DD  DSN=OUTPUT.FILE.NAME.HERE,
//             DISP=(NEW,CATLG,DELETE),                     
//             UNIT=SYSDA                                   
//*                                                         
//SYSPUNCH DD SYSOUT=*                                     
//*                                                         
//SYSTSPRT DD  SYSOUT=*                                     
//SYSPRINT DD  SYSOUT=*                                     
//SYSUDUMP DD  SYSOUT=*                                     
//SYSTSIN  DD  *                                           
  DSN SYSTEM(DB2G)                                         
  RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) -                   
  PARM('SQL')                                               
/*                                                           
//*                                                         
//SYSIN    DD  *                                             
    YOUR QUERY STATEMENTS
/*                                                           
//*                                                         


You may need bit modification in JCL specific to your site.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Aug 02, 2007 6:42 pm    Post subject:
Reply with quote

You can read more about the sample programs 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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm


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