Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If your records are already in sorted order (as shown in your example), you can use a DFSORT MERGE job like the following:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN01 DD *
604398392 - 1 - 1
604398392 - 1 - 1
604398392 - 1 - 2
604398392 - 1 - 2
604398392 - 1 - 2
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
//SORTOUT DD SYSOUT=*
//SYSIN DD *
MERGE FIELDS=(1,17,CH,A)
SUM FIELDS=NONE
|
or a DFSORT/ICETOOL SELECT job like the following:
Code: |
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
604398392 - 1 - 1
604398392 - 1 - 1
604398392 - 1 - 2
604398392 - 1 - 2
604398392 - 1 - 2
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,17,CH) FIRST USING(CTL1)
//CTL1CNTL DD *
OPTION COPY
|
If your records are NOT already in sorted order, you can use a DFSORT SORT job like the following:
Code: |
//S3 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
604398392 - 1 - 1
604398392 - 1 - 1
604398392 - 1 - 2
604398392 - 1 - 2
604398392 - 1 - 2
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,17,CH,A)
SUM FIELDS=NONE
|
or a DFSORT/ICETOOL SELECT job like the following:
Code: |
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
604398392 - 1 - 1
604398392 - 1 - 1
604398392 - 1 - 2
604398392 - 1 - 2
604398392 - 1 - 2
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
604398392 - 1 - 3
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,17,CH) FIRST
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|