Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

DB2 :: RE: JCL to Set Return code based on DB2 SQL query result

$
0
0
Author: daveporcelan
Posted: Tue Mar 14, 2017 12:18 am (GMT 5.5)

One way to approach this:

1) Add FETCH FIRST 2 ROWS ONLY to your sql

2) Write the results (data) to a dataset (in your JCL)

3) Process the above dataset using product of your choice (SORT, IDCAMS, REXX), setting the rcode accordingly. This would vary for 0, 1, or 2 rows found.


Viewing all articles
Browse latest Browse all 8500

Trending Articles