Hi,I have two GDG generations.Each contains some set of user ids.Pls See below for details.

Note:There are no keys present other than the user id i.e no other info in the datasets except user ids

What I need is unpaired user ids present in GDG-1 alone with duplicates.i.e as per the below info in fig-1, CCCC,DDDD,SSSS is present only in GDG-1 so I get that in the outputbut AAAA is present twice in GDG-1 and only once in GDG-2 hence I need AAAA once in the ouput dataset along with (CCCC,DDDD,SSSS) but am unable to achieve it.

Output GDG what I Need------------------------------------AAAACCCCDDDDSSSS

But what I actually get by using join keys is below

Output GDG what I get using JOIN keys---------------------------------------CCCCDDDDSSSS

I tried using join keys also please let me know if you have any other approach.I have a very minimal experience in coding..but still I tried to a extent.Unfortunately couldn't able to achieve the results.Looking forward for some help.Thank you.

Now you need to be a little clearer with your sample input and expected output. You need to show single match (one matching key on F1 and F2) multiple one-to-one match (two or more but same number for each key), single to multiple (one to two should be enough) and multiple to single (two to one). Then expected output for those.

And post the full sysout from your step, inside the Code tags if possible (if you want to see how it works, click on the Quote button and look at the above two lines). This will help us determine which SORT product you have and its capabilities.

sorry it's not possible for me to post the sysout hereIf you need my SORT product details, I see it as SYNCSORT for Z/os 1.4.1.0N

I need only unmatched records in GDG1 only (along with one instance of AAAA)

AAAA is present twice in GDG-1 whereas it is present only once in GDG2.As per the code I have written what is happening is that its removing duplicates then trying to compareand hence I am not getting the AAAA id which is present for the second time in GDG1.

When I include - SORT fields=(12,6,A) & SORT fields=(22,6,A) in JNF1CNTL,JNF2CNTL statementsI get 'SORT statement - syntax error'. But I think am giving it right.Searched a lot but couldn't find anything.

I've not used SyncSort with JOINKEYS. The way DFSORT works the SORT is automatic, on the keys. If you can't specify SORT in the JNFnCNTL, then it looks like SyncSort is the same.

So, why was the output you showed not SORTed? Plan B is that you don't have the correct start positions. You also have the RESTART on the same positions, and if you look at the output you showed the AAAA get number 1, 1, 2 and should have been 1, 2, 3.