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: Arun Raj
Posted: Tue Mar 14, 2017 9:30 pm (GMT 5.5)

vinu78 wrote:
Unfortunately my shop has SYNCSORT installed and so ICETOOL wont work
In general Syncsort shops would already have the Syncsort's ICETOOL alternative - SYNCTOOL installed. And the above ICETOOL job should run and give you the same results unless you tried it already and it gave you an error.

Normally both PGM=ICETOOL OR PGM=SYNCTOOL would invoke the SYNCTOOL package at a Syncsort shop.
vinu78 wrote:
if the number of records got from STEP01 is > 1 or for empty file. So for Rec count exactly equal to 1, I need to skip STEP03 and then proceed with downstream steps.

Now back to your 'new' requirement, from your latest post it seems like you still have 2 scenarios unless I got it wrong.
Case1 - records > 1 or records = 0
Case2 - records = 1
If you modify the control card to use EQUAL, it would return RC=4 when you have exactly 1 record and RC=0 for the rest, ie. records = 0 or > 1
Code:
//TOOLIN   DD *             
 COUNT FROM(IN) RC4 EQUAL(1)

EDIT: Alternatively NOTEQUAL(1) could be used, which would return RC=0 for 1-record and RC=4 for everything else.
_________________
Arun
----------------------------------------------------------------------------------------------------
Love is like an hourglass, with the heart filling up as the brain empties. -Jules Renard


Viewing all articles
Browse latest Browse all 8500

Trending Articles