Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Executing SQL Query Through JCL.

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

New User


Joined: 27 Sep 2010
Posts: 21
Location: Boudh

PostPosted: Fri Jun 06, 2014 4:04 pm    Post subject: Executing SQL Query Through JCL.
Reply with quote

RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) ---> The o/p gets printed in SYSPRINT.
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL') ---> The o/p can be moved to a PS file. need to give the PS file name in DD name SYSREC00


For moving the output to a PS File:

//JOBCARD
//PS000 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSDBOUT DD SYSOUT=*
//SYSREC00 DD DSN=<PSFile_Name>,
// DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPUNCH DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(<System_Name>)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL')
/*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
<SQL Query>
/*


To have the output in Sysprint:

//JOBCARD
//PS000 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSDBOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSPUNCH DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(<System_Name>)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2)
LIB (<Library_Name>)
END
/*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
<SQL Query>
/*
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1568
Location: Andromeda Galaxy

PostPosted: Fri Jun 06, 2014 4:47 pm    Post subject:
Reply with quote

Are you giving a sample or stating a problem?
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10700
Location: italy

PostPosted: Fri Jun 06, 2014 5:32 pm    Post subject: Reply to: Executing SQL Query Through JCL.
Reply with quote

they look like hints ...

but ...

- use the code tags to make the code snippets more readable

- and ...
since You want to look like an expert refrain from using invalid terminology

You do not run a query thru jcl ...
jcl is just the weird language used to in tell the system to run some program

so You might be better off talking about ...

DB2/SQL utilities that can be used to execute a query without having to write a program

and show the JCL used to invoke that utility
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Tue Jun 10, 2014 8:03 pm    Post subject:
Reply with quote

But , What is the issue here or is it just a fyi? icon_confused.gif
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 Mainframe ISPREDIT Macro query upendrasri TSO/ISPF 3 Wed May 27, 2020 1:12 pm
No new posts DFSORT Output file order query A_programmers DFSORT/ICETOOL 2 Thu Mar 26, 2020 11:59 pm
No new posts doubt when executing a file when logg... Renato Zangerolami TSO/ISPF 2 Fri Feb 07, 2020 6:07 pm
No new posts Executing Linux Shell Script from Mai... yuvan All Other Mainframe Topics 9 Fri Jan 17, 2020 4:24 pm
No new posts Getting sqlcode 805 while executing R... abdulrafi DB2 10 Thu Dec 26, 2019 11:46 am

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