Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7315

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: 7315

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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us