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
 
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: 1542
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
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

Senior Member


Joined: 21 Sep 2010
Posts: 1806
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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm

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