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 HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm
No new posts Batch job tuning sgandhla Testing & Performance analysis 5 Fri Mar 24, 2017 9:41 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


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