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
 
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 How to force a select query to abend neo4u DB2 5 Mon Apr 23, 2018 1:36 pm
No new posts batch cobol/db2 paragraph fall thru a... alois eisshofer COBOL Programming 5 Wed Mar 14, 2018 12:21 am
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am
No new posts How to replace the below query? pkmurali DB2 12 Tue Feb 27, 2018 9:51 pm
No new posts Need Guidance regarding UPDATE query Poha Eater DB2 3 Mon Feb 12, 2018 11:35 pm

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