First Please take a few minutes to review your post before submit....
It is as if you are asking someone to do it here .. I find it rude at least...
To answer your question:
1. Your need to use ICETOOL for multiple passes along with joinkeys
2. First pass you need to prepare for //JNF1CNTL where JNF1CNTL should have your key and nth SEQUENCE number for each group (Ex: 145678 and 4 ) You need to do that using INREC + Adding SEQUNCE NUMBER + SORT descending based on Sequence number and SELECT first and assign to a temp file which would serve as you JNF1CNTL
3.Assign your original file for JNF2CNTL
4.Inrec add a sequnce to your original file
5.join both files based on client number
7.When Sequence number matches from both the files dont add ',' else add
Or you could do something like this by joining the same input to itself, which does not involve SORTing. I have assumed the input attributes to be FB/LRECL-80.
You could modify it as per your actual requirement.
Joined: 10 May 2007 Posts: 2312 Location: Hampshire, UK
After 13 years as a member of the forum you should know to use the code-tags when postings code, data, screenshots etc.
Also after so long in the industry you should know the difference between a data set and a file.
If you don't care about the sort order then try below solution as well else add one more step to SORT it back to original order. If the records are more like in millions then probably this is not the right way to do it.