Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Based on your sample data, you could use the following SyncSort for z/OS JOIN application to acquire your desired output:
Code: |
//STEP1 EXEC PGM=SORT
//SORTJNF1 DD *
000100
000200
000300
000400
000500
000600
000700
000800
000900
001000
//SORTJNF2 DD *
0A01
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(5,1,A),SORTED
JOINKEYS FILES=F2,FIELDS=(5,1,A),SORTED
REFORMAT FIELDS=(F2:1,4,F1:5,11)
SORT FIELDS=COPY
/* |
However, if your real data does not have a blank in position 5 for both files, and the data is not in sorted order, then this will need to be modified accordingly.
Alternately, you could use the following job:
Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD *
0A01
// DD *
000100
000200
000300
000400
000500
000600
000700
000800
000900
001000
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,NE,C' '),PUSH=(1:1,4))
OUTFIL INCLUDE=(10,6,CH,NE,C' ')
/* |
Please note that this 2nd solution requires SyncSort for z/OS 1.3.2.
Hope this helps. |
|