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

Is it possible to execute the DB2 query from batch


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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

Superior Member


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

PostPosted: Thu Aug 02, 2007 2:11 pm
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: 2358
Location: Israel

PostPosted: Thu Aug 02, 2007 6:42 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts RC query -Time column CA Products 3
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
Search our Forums:

Back to Top