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
 

 

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: 6966
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: 10232
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 Batch job tuning sgandhla Testing & Performance analysis 0 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 Determine Region with max bandwidth f... seahawk789 COBOL Programming 3 Mon Feb 27, 2017 8:26 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