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

Problem in Running Query via JCL


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Tue Oct 18, 2016 11:11 pm
Reply with quote

Hi All,
i am using below kind of job to run SQL query (Cannot post original job as i dont have google access inside ODC)

Code:
//STEP001 EXEC PGM=IKJEFT01,DYNAMNBR=20,         
//             REGION=4M
//SYSTSPRT DD  SYSOUT=*                           
//SYSTSIN  DD  *                                 
 DSN SYSTEM(DB2D)                                 
 RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -             
 LIB('db2.load.library')                         
/*                                               
//SYSPRINT DD  SYSOUT=*                           
//SYSIN DD  *                                     
   SQL QUERY
/*   


This job is working fine and i am getting results of query in SYSPRINT statement.
But i want result of SQL in my PS so i am trying below

Code:
//SYSPRINT DD  DSN=MYPS,DISP=SHR


But i am getting some printing error.Please share your thoughts on this.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Oct 18, 2016 11:23 pm
Reply with quote

Saying that you are getting "some printing error" is completely useless; you should know that by now. Give us, at minimum, the message number and text.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Wed Oct 19, 2016 2:37 am
Reply with quote

vickey_dw wrote:

Code:
//SYSPRINT DD  DSN=MYPS,DISP=SHR


Do you really want to use DISP=SHR ?

.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2672
Location: NYC,USA

PostPosted: Wed Oct 19, 2016 3:06 am
Reply with quote

Your LRECL will be max up to 133 because of DSNTEP2 so why dn't you use DSNTIAUL and if you don't know then search on internet.
This link will help you; but make sure next time you do proper research and give us proper information about the error message.
ibmmainframes.com/about34492.html
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 DB2 SQL query to read and update data... DB2 12
No new posts Cobol-db2 : SQL query is running for ... DB2 4
No new posts Reading subsequent rows in a query. DB2 12
No new posts SYSIBM Tables Query DB2 8
No new posts problem in select max when executing ... IMS DB/DC 6
Search our Forums:

Back to Top