View previous topic :: View next topic
|
Author |
Message |
shanudarling Warnings : 1 New User
Joined: 20 Dec 2006 Posts: 55 Location: noida
|
|
|
|
Hi,
I have an input file
Code: |
FILE1
RECORDS NUMBER
1111 ABC
1110 LMN
1121 PQR
1123 XYZ |
My requirement is to sort this file on the basis of 1st four bytes after skipping the first 2 header records. After sort, the output file should look like -
The header records should also be written to the output file.
Code: |
FILE1
RECORDS NUMBER
1110 LMN
1111 ABC
1121 PQR
1123 XYZ |
Please help.
Thanks. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Try DATASORT
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
FILE1
RECORDS NUMBER
1111 ABC
1110 LMN
1121 PQR
1123 XYZ
//OUT DD SYSOUT=*
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER(2) USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=(1,4,CH,A) |
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3049 Location: NYC,USA
|
|
|
|
Hello,
As Pandora suggested the DATASORT , you can find more on such tricks by just clicking to the below link.
ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf
For your question please see chapter "Sort detail records between headers and trailers" in detail with examples and explaination as to how this works. |
|
Back to top |
|
|
|