JCL SORT

3 posts / 0 new
Last post
Anonymous (not verified)
JCL SORT

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

Offline
Joined: 12/26/2011 - 06:34
Requirement appears to have

Requirement appears to have been changed, so the original reply is no longer true - suggestion removed.

Anonymous (not verified)
Step1: Exesute the SORT

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. 

Log in or register to post comments
Sponsored Listing

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer

Navigation