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

Running a DB2 query in batch


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

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

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

Global Moderator


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

PostPosted: Sat Apr 18, 2009 8:09 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Apr 18, 2009 8:28 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
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