Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1319 Location: Bamberg, Germany
|
|
|
|
Input:
Code: |
//JUSTDOIT EXEC PGM=ICEMAN
//F1 DD *
ABCDEFGH
IJKLMNOP
QRSTUVEX
YZ12345
/*
//F2 DD *
12345
67890
12313
45543
32454
12123
98762
32684
74456
69683
35412
31365
64532
36457
75347
12347
44543
65554
75454
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS
JOINKEYS F1=F1,FIELDS=(81,1,A),TYPE=F,SORTED
JOINKEYS F2=F2,FIELDS=(81,1,A),TYPE=F
JOIN UNPAIRED,F2
REFORMAT FIELDS=(F2:1,83,?,F1:1,83)
SORT FIELDS=(82,2,ZD,A)
OUTFIL FNAMES=(SORTOUT),
IFTHEN=(WHEN=(84,1,CH,EQ,C'B',AND,165,3,ZD,NE,+4),
BUILD=(85,80)),
IFTHEN=(WHEN=(84,1,CH,EQ,C'B',AND,165,3,ZD,EQ,+4),
BUILD=(85,80,/,1,80)),
IFTHEN=(WHEN=NONE,BUILD=(1,80))
END
/*
//JNF1CNTL DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(81:+0,TO=ZD,LENGTH=2,SEQNUM,1,ZD,START=1))
END
/*
//JNF2CNTL DD *
INREC IFTHEN=(WHEN=GROUP,PUSH=(82:ID=1,SEQ=1),RECORDS=5),
IFTHEN=(WHEN=(83,1,ZD,EQ,+1),OVERLAY=(81:+0,ZD,LENGTH=1))
END
/* |
Output:
Code: |
****** **************************** Datenanfang ******
000001 ABCDEFGH
000002 IJKLMNOP
000003 QRSTUVEX
000004 YZ12345
000005 12345
000006 67890
000007 12313
000008 45543
000009 32454
000010 ABCDEFGH
000011 IJKLMNOP
000012 QRSTUVEX
000013 YZ12345
000014 12123
000015 98762
000016 32684
000017 74456
000018 69683
000019 ABCDEFGH
000020 IJKLMNOP
000021 QRSTUVEX
000022 YZ12345
000023 35412
000024 31365
000025 64532
000026 36457
000027 75347
000028 ABCDEFGH
000029 IJKLMNOP
000030 QRSTUVEX
000031 YZ12345
000032 12347
000033 44543
000034 65554
000035 75454
****** **************************** Datenende ******** |
|
|