anthony.pangestu
New User
Joined: 26 Oct 2017 Posts: 3 Location: Indonesia
|
|
|
|
Hello,
I need help with finding missing numbers from a set of data, with the input as such:
AAA 001
AAA 002
AAA 004
AAA 005
BBB 003
BBB 005
CCC 001
CCC 002
CCC 003
CCC 004
CCC 005
DDD 001
DDD 002
DDD 003
The requirement is for every (1,3) key with (5,3) not found between the range of 001 - 005
The expected result:
AAA 003
BBB 001
BBB 002
BBB 004
DDD 004
DDD 005
Is this possible to achieve with DFSORT or ICETOOL? Thank you. |
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1335 Location: Bamberg, Germany
|
|
|
|
Please use Code Tags when presenting Code/Data.
Code: |
//MASTER EXEC PGM=ICEMAN
//SORTIN DD *
AAA 001
AAA 002
AAA 004
AAA 005
BBB 003
BBB 005
CCC 001
CCC 002
CCC 003
CCC 004
CCC 005
DDD 001
DDD 002
DDD 003
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD DISP=(NEW,PASS),UNIT=SYSALLDA,SPACE=(CYL,(2,1,))
//SYSIN DD *
SORT FIELDS=(1,3,CH,A)
SUM FIELDS=(NONE)
OUTFIL FNAMES=(SORTOUT),
REMOVECC,REPEAT=5,
BUILD=(1,3,X,SEQNUM,3,ZD,RESTART=(1,3))
END
/*
//WHATEVER EXEC PGM=ICEMAN
//F1 DD DISP=(OLD,PASS),DSN=*.MASTER.SORTOUT
//F2 DD *
AAA 001
AAA 002
AAA 004
AAA 005
BBB 003
BBB 005
CCC 001
CCC 002
CCC 003
CCC 004
CCC 005
DDD 001
DDD 002
DDD 003
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=F1,FIELDS(1,7,A)
JOINKEYS F2=F2,FIELDS(1,7,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,7)
END
/* |
Output:
Code: |
Command ===>
****** ***************
000001 AAA 003
000002 BBB 001
000003 BBB 002
000004 BBB 004
000005 DDD 004
000006 DDD 005
****** *************** |
|
|