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 identify last record in each group of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Thu Jun 11, 2015 9:12 pm    Post subject: How to identify last record in each group of records
Reply with quote

Hi

In the below e.g. how to identify the end of a group of records.


Record type A - appears for each customer no. in file. Record type B is the customer details.Both A and B are in position 1. The no.of times B may occur for a customer is not fixed.

A
B
B
B
A
B
B
B
B
A
B
A
B
B


Using when=group , the records are grouped, so basically the first 4 records are a group as they are details of a customer. Then the next 5 records are details of another customer. SEQNUM with RESTART doesnt seem to work when tried with INREC IFTHEN=(WHEN=GROUP) option.

Is there any way to identify the end of a group here ? i.e the last record in each group ?

The o/p should have A , the 1st B and last B in each group.

Thanks
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jun 11, 2015 11:43 pm    Post subject: Reply to: How to identify last record in each group of records
Reply with quote

If you start with this topic, and follow the links, you should find sufficient to allow you to identify the last, and then select with OUTFIL OMIT=/INCLUDE=.
Back to top
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Fri Jun 12, 2015 6:14 am    Post subject:
Reply with quote

Hi Bill
If you can share the links it will be of great help. I will go through them.


Thanks
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Jun 12, 2015 11:48 am    Post subject: Reply to: How to identify last record in each group of records
Reply with quote

Sorry about that, I've updated the original. Yesterday was not a good day for typing.
Back to top
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Fri Jun 12, 2015 8:33 pm    Post subject:
Reply with quote

Thanks Bill. I read your post in the link - http://www.ibmmainframes.com/viewtopic.php?p=300686#300686 of using same input twice.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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