Please give me the solution in JCL SORT for the required output !!
The input file has the following records
Peter
Peter
Peter
Ram
Ram
Josh
Josh
Josh
My required output file should be
Peter
Ram
Josh
Peter
Ram
Josh
Peter
Josh
Please give me the solution in JCL SORT for the required output !!
The input file has the following records
Peter
Peter
Peter
Ram
Ram
Josh
Josh
Josh
My required output file should be
Peter
Ram
Josh
Peter
Ram
Josh
Peter
Josh
Click the +1 button below to share it with your friends and colleagues
Requirement appears to have been changed, so the original reply is no longer true - suggestion removed.
Step1:
Exesute the SORT program with SORTIN DD DSN=your input file(FILE1).
SORTXSUM DD DSN=FILE2
SORTOUT DD DSN=FILE3
Your sort card will be
SORT FIELDS=(1,,CH,A)
SUM FIELDS=NONE,XSUM
Step2:
Exesute the SORT program with SORTIN DD DSN=FILE2
SORTXSUM DD DSN=FILE4
SORTOUT DD DSN=FILE5
Your sort card will be
SORT FIELDS=(1,,CH,A)
SUM FIELDS=NONE,XSUM
Step3:
Exesute the SORT program with SORTIN DD DSN=FILE4
SORTXSUM DD DSN=FILE6
SORTOUT DD DSN=FILE7
Your sort card will be
SORT FIELDS=(1,,CH,A)
SUM FIELDS=NONE,XSUM
Step4:
Merge FILE3, FILE5 and FILE7. You will get the desired O/P.
Sujoy Ghosh.