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
 

 

Problem in Running Query via JCL

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

New User


Joined: 10 Jun 2015
Posts: 30
Location: India

PostPosted: Tue Oct 18, 2016 11:11 pm    Post subject: Problem in Running Query via JCL
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: 1738
Location: Bloomington, IL

PostPosted: Tue Oct 18, 2016 11:23 pm    Post subject:
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: 331
Location: USA

PostPosted: Wed Oct 19, 2016 2:37 am    Post subject: Re: Problem in Running Query via JCL
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

Senior Member


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

PostPosted: Wed Oct 19, 2016 3:06 am    Post subject:
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.
http://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    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
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts SQL Query optimization. arunsoods DB2 12 Sun Sep 04, 2016 6:27 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us