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
 
Running a DB2 query in batch

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

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Sat Apr 18, 2009 5:17 pm    Post subject: Running a DB2 query in batch
Reply with quote

Hi,
Can anybody tell me how to run a db2 query in batch.I just have to run a select query which displays all the information in my table.Can you please provide the jcl??

Thanks,
shchan
Back to top
View user's profile Send private message

PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Sat Apr 18, 2009 7:59 pm    Post subject:
Reply with quote

DSNTEP2 DSNTEP4 ..
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Sat Apr 18, 2009 8:09 pm    Post subject:
Reply with quote

here is something to start with,
obviously you need to change things that apply to your site.

this is dsntiaul, which you will need to have authority.
try it, if it works you have authority, if not, you don't.

Code:
//STEP0170 EXEC PGM=IKJEFT01                           
//SYSTSPRT DD  SYSOUT=*,DCB=BLKSIZE=121                 
//SYSPRINT DD  SYSOUT=*                                 
//SYSTSIN  DD  *                                       
 DSN SYSTEM(DB2P)                                       
 RUN  PROGRAM(DSNTIAUL) -                               
      PLAN(DSNTIB81)    -                               
      PARMS('SQL,1,TOLWARN(YES)') -                     
      LIB('DB2P.DSN.RUNLIB.LOAD')                       
//SYSREC00 DD  DSN=TF.MD.GIG.C4600,                     
//             SPACE=(CYL,(3000,2000),RLSE),           
//             DCB=(RECFM=FB,LRECL=1000,BLKSIZE=26000),
//             DISP=(NEW,CATLG,DELETE)                 
//SYSPUNCH DD SYSOUT=*                                 
//SYSIN    DD *                                         
 SELECT your select statement here
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10309
Location: italy

PostPosted: Sat Apr 18, 2009 8:28 pm    Post subject: Reply to: Running a DB2 query in batch
Reply with quote

Quote:
I just have to run a select query which displays all the information in my table.Can you please provide the jcl??


remember the jcl provided are SAMPLES which certainly work in the responder' s environment
but have to be checked and tested in YOUR environment
I have seen countless cases of these kind of dialogs
... Q give me the jcl
... A some jcl is posted
... Q it does not work
... A I tested it works in my environment
... Q please help me
... and so on and so on

for this kind of issues the BEST source is Your organization
( a colleague or a support group )
maybe they have standards and the answers given might not fit

meditate, meditate
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Tue Apr 21, 2009 12:47 pm    Post subject:
Reply with quote

Thanks Dick Brenholtz
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 Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Generate public-private key in batch ... vasanthz All Other Mainframe Topics 3 Fri Sep 15, 2017 9:20 am
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm

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