MERGE is selected by DFSORT from the F2 subtask, but it seems to ignore the SUM FIELDS=NONE statement. If I don't use the SORTED option it behaves as expected, but I'll like to avoid sorting an already sorted dataset. Is there a way to remove duplicates from F2 without using another job step?
Job step
//STEP010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//MASTER DD *
1AAAAAAAAA
5BBBBBBBBB
3CCCCCCCCC
4DDDDDDDDD
//PULL DD *
3
5
5
5
7
//SORTOUT DD SYSOUT=*
//DFSPARM DD *
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION
JOINKEYS F1=MASTER,FIELDS=(1,1,A)
JOINKEYS F2=PULL,FIELDS=(1,1,A),SORTED
REFORMAT FIELDS=(F1:1,10)
* CONTROL STATEMENT FOR MAIN TASK
OPTION COPY
//JNF2CNTL DD *
* CONTROL STATEMENT FOR SUBTASK2 (F2)
SUM FIELDS=NONE
/*
//*
//SYSOUT DD SYSOUT=*
//MASTER DD *
1AAAAAAAAA
5BBBBBBBBB
3CCCCCCCCC
4DDDDDDDDD
//PULL DD *
3
5
5
5
7
//SORTOUT DD SYSOUT=*
//DFSPARM DD *
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION
JOINKEYS F1=MASTER,FIELDS=(1,1,A)
JOINKEYS F2=PULL,FIELDS=(1,1,A),SORTED
REFORMAT FIELDS=(F1:1,10)
* CONTROL STATEMENT FOR MAIN TASK
OPTION COPY
//JNF2CNTL DD *
* CONTROL STATEMENT FOR SUBTASK2 (F2)
SUM FIELDS=NONE
/*
//*
Actual OUTPUT
3CCCCCCCCC
5BBBBBBBBB
5BBBBBBBBB
5BBBBBBBBB
5BBBBBBBBB
5BBBBBBBBB
5BBBBBBBBB
Expected OUTPUT
3CCCCCCCCC
5BBBBBBBBB
5BBBBBBBBB