Here below considerations took place,
1)first 1-5 positions cosiderd and and unique count is added at 3rd place.
2)Combination of first 1-2 and 7-4 are taken and unique count is added at 4th place.
3)Combination of first 1-2 and 14-4 are taken and unique counts is added to 5th place.
I have tried this using below approach,
1) first I performed 3 steps which would perform to remove duplicated based on above 3 combinations.
2)Again written 3 more steps to get the counts at different postions as per above description.
3) And then written a program which would make my final output file as shown above.
I aggree that it is a very long procedure that I followed, but I would need some suggestion/SORT to optimise this requirement.
Skolusu,
Thanks for correcting me.
Here is the updated one,
Here below considerations took place,
1)first 1-7 positions cosiderd and and unique count is added at 3rd place.
2)Combination of first 1-2 and 9-4 are taken and unique count is added at 4th place.
3)Combination of first 1-2 and 14-4 are taken and unique counts is added to 5th place.
you may try the below not tested fully, but hoping it gives you some idea
on how to proceed , it can be further optimised also....and has to be corrected aswell..for duplicates
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Please do not post "solutions" that are known to be incomplete or do not work (i.e. have not been tested) . . .
If we had no solid support, this might be ok, but as we have Skolusu (DFSORT Developer) and others, there is no need to just "throw things" onto the topic. All this does is take time and provides little for the TS.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
knickraj,
I know you are keen, but three passes of the file followed by a SPLICE is unlikely to be close to a good solution. Use of SPLICE is rare. Multiple passes only make sense when they can't be avoided.
Having got an idea, don't just post it if you think it needs more work: give it the work, or leave it for another time, please.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Rohit Umarjikar wrote:
Knickraj,
Thanks for your view
I am getting output like,
Code:
A 3
B 4
A 3
B 4
A 3
B 4
Rohit Umarjikar,
1. You did not run the JCL as is given by Knickraj. If you had the JCL given by knickraj as is you wud have got
Code:
AA 3 3 3
BB 4 4 4
2. For the sample input you shown and conditions you specified , I have no idea as to how you arrived at the counts as
Code:
AA232
BB222
Can you explain how you got those counts?
3. You show the counts as single byte. What happens if the counts exceed that?
Knickraj,
As Bill mentioned you don't need that many passes to get the desired results. It can be done in a single pass. Any Sort solution should not exceed more than 3 passes (high limit). If you need more than 3 passes of data , you can sit down and write a program to get the results.
Never ever go by the description of how the problem is solved, look at it as "I have this input and I need this output with these conditions" and develop the logic to achieve it. Trust me you would find innovative ideas to solve the same problem when you look at the problem in that manner.