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
 

 

How to get the number of rows returned by SELECT sql in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
mpawankumar

New User


Joined: 26 Sep 2007
Posts: 7
Location: Chennai

PostPosted: Thu Dec 04, 2008 9:04 pm    Post subject: How to get the number of rows returned by SELECT sql in JCL
Reply with quote

How to get the number of rows returned by a SELECT sql in JCL. If the number of returned rows are zero i want to trigger the next job in the sequence. I am using ISPSTART command to run the query in QMF and storing the result in a PS.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Thu Dec 04, 2008 9:46 pm    Post subject:
Reply with quote

Select the count into a dataset
Check the dataset for count>0 using sort and return 0 or 4 accordingly
Run the successor job based on the above return code
Back to top
View user's profile Send private message
mpawankumar

New User


Joined: 26 Sep 2007
Posts: 7
Location: Chennai

PostPosted: Thu Dec 04, 2008 10:05 pm    Post subject: Reply to: How to get the number of rows returned by SELECT s
Reply with quote

Thanks Arun
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
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 Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm


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