# abend sort based on count records in group

Author Message
anatol

Active User

Joined: 20 May 2010
Posts: 121

Posted: Mon Oct 17, 2016 10:10 pm

Hi,

I have file ( need just idea, so let it FB=80):

 Code: 111111 111111 111111 111111 111111 111111 111111 111111 111111 111111 222222 222222 222222 222222 222222 222222

group is in position 1-6.
Is it possible to abend sort if records in any group is more than 7 ... Based on the file in example - abend, because group 111111 have more than 7 records
Rohit Umarjikar

Global Moderator

Joined: 21 Sep 2010
Posts: 2632
Location: NYC,USA

 Posted: Mon Oct 17, 2016 10:28 pm
anatol

Active User

Joined: 20 May 2010
Posts: 121

 Posted: Mon Oct 17, 2016 11:21 pm Thank you ... I will try to check if I can use NULLOFL for my task... kind of doubt
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

Posted: Tue Oct 18, 2016 12:20 am

Well, you can very easily get an RC=4 if there are no groups with more than seven records (or any arbitrary known value). Have a subsequent step which abends when you get RC=0 in the step. Or deal with the RC=4 as good RC=0 as bad in your JCL, or your Scheduler.

Here's an OVERLAY. Put this under an IFTHEN=(WHEN=(logicalexpression) for your required condition,

If you desperately, desperately want a fake abend, that should do it.
anatol

Active User

Joined: 20 May 2010
Posts: 121

 Posted: Tue Oct 18, 2016 12:29 am Thank you, Bill .. I think it is better to work with RC, than force to abend . So include to output only records with more than 7 in group and RC=4 if output is empty, right?
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

 Posted: Tue Oct 18, 2016 2:08 am Yes.
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics Installing sort utilities on hercules... DFSORT/ICETOOL 4 Add column to existing records using ... JCL & VSAM 2 Syncsort- Merging two records into on... SYNCSORT 3 Sort card help to prepare status report DFSORT/ICETOOL 13 How to find orphaned MCDS D records. JCL & VSAM 15
Search our Forums: