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

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

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 query to fetch record which has only ... maxsubrat DB2 9 Mon Dec 11, 2017 5:03 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm

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