The values appearing in 1st, 7th, 13th and 21st (count of detail records) are the keys to be compared between sets of records. The 1st and 3rd sets are same hence should contain same sequence number and other sets with different sequence numbers at 30th column.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Sun Mar 27, 2011 1:14 pm Post subject:
mf_user,
Do you really need the order of records in the same order as input? If the order is not important then the following DFSORT JCL will give you the results. The result set is based on the key (1,24) on the 'set' record which acts like a header for the group.
Hi, Thanks for the solution you've provided. Yes, I need to get the output as it appears in the order. Can you please let me know how to achieve it?
Thanks a lot. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Mar 28, 2011 12:27 pm Post subject:
mf_user,
I can't think of a way to get the output as you desired. You want the order of the records as is and no break in the group number which is not easy to achieve via SORT. It would require more than 3 passes of data which is think is a mere waste of resources.
Posted: Tue Mar 29, 2011 6:42 am Post subject: my bad luck
Ok Kolusu.....my bad luck _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu Mar 31, 2011 3:09 pm Post subject:
mickeygoo,
Did you notice that there are 2 sets of SET1 0123 ABYZ 0003 records? And both of them have need to have the same group number? By using INREC you will have a break in group numbering. _________________ Kolusu
www.linkedin.com/in/kolusu
Did you notice that there are 2 sets of SET1 0123 ABYZ 0003 records? And both of them have need to have the same group number? By using INREC you will have a break in group numbering.
Actually, I did, but I don't quite understand your point. I thought of adding the WHEN=INIT to add a non-group / non-key-specific sequence # - like a record # - to the input record, the follow up with the rest of the code you specified, just so that there's something he can re-sort with to get the original sort order. I didn't try and code it all out and test it - I just saw this post while I was searching for something else - and thought I'd throw in my 2c. Maybe it needs a HIT=NEXT as well.
I enjoy these discussions - helps me learn about DFSORT better than just reading someone else's code, or reading thru the manuals. And the things people come up with to try and use the utility, coupled with your and Frank's and everyone else's out-of-the box suggestions - it's mind-boggling. _________________ Not an expert, but I did stay at a Holiday Inn... though it has been a while...
Take a look at group 1 and 3. The are duplicate groups , so both of them should have the same group number 1 which is quite easy to do. However you will skip a group number ( 3 in this case) and your group number will be 1,2,4,5. so whenever there is a duplicate group, there will be a skip and if there are more duplicate groups then you will notice huge spikes in the group numbers. _________________ Kolusu
www.linkedin.com/in/kolusu
I am still optimistic that something would turn up _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum