View previous topic :: View next topic
|
Author |
Message |
Kumaresan.nk
New User
Joined: 22 Mar 2010 Posts: 31 Location: Chennai
|
|
|
|
Hi,
I'm taking the count of records which have a field set as 'Y' in my input dataset. Is it possible to abend the job when the count drops below a certain number say 1500. Is it possible to do it in SORT ? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
It's possible to set a condition code using DFSORT in such circumstances. I doubt very much that you want to ABEND.
Garry. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
As Garry mentioned you could make DFSORT to set RC like below,
Code: |
//JS020 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=WELLS.SORTIN
//SYSOUT DD SYSOUT=*
//TOOLIN DD *
COUNT FROM(SORTIN) LOWER(1500) RC4
/*
//SYSUDUMP DD SYSOUT=*
/* |
step returns RC of 4 if record count is less than 1500.
Hope it helps. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is a way to set an abend, you may need to adjust the position of "Y"
Code: |
//STEP0001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input-file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
DEBUG ABEND
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'Y'),OVERLAY=(081:SEQNUM,8,ZD))
OUTFIL INCLUDE=(81,8,ZD,EQ,1500),NULLOFL=RC16
/*
|
Gerry |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Kumaresan.nk,
The following DFSORT JCL will abend when the number of 'y' in position are less than 5. A slight modification from gcicchet's post with INCLUDE COND to reduce the overhead of reading all records.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A
A
Y
A
Y
A
Y
A
//SORTOUT DD SYSOUT=*
//SYSIN DD *
DEBUG ABEND
SORT FIELDS=COPY
INCLUDE COND=(1,1,CH,EQ,C'Y')
INREC BUILD=(SEQNUM,4,ZD)
OUTFIL INCLUDE=(1,4,ZD,EQ,5),NULLOFL=RC16
//* |
|
|
Back to top |
|
|
|