I was remembered to post my question in the right board. So my problem has something to do with sort or icetool and here we are.
See the attached images to my input and output data.Instead of displaying the records in its original format, because data could only be interpredet by using hex on in ispf editor i used a tool named insync with an overlay to make data visible.
Columns num_vnr, betrag and buschl are the columns to make my output data. To each num_vnr i have several records with buschl 20 (not only one as in this example), 100 (not only one as in this example) and 105. Take a look to the input dataset with the records with num_vnr equal to 82308036. you can see a record to buschl 20 with betrag (translation to english price or amount) +125,28. This ist the second record in input data set. The same num_vnr has, this is the third record, with buschl 105 the same value to betrag if you multiply it by -1. For me in this context these are siblings. Both lines (record 2 and record 3) should be eliminated. But remember, i can have several records wit the same buschl (20, 100, 105) and maybe i have also two or more records with buschl 20 and the same value to betrag and a different quantity to buschl 105. I have to found siblings. any other record must be in the ouput file. The record with buschl 100 must be also in output record and is not in focus to this task. Also it's not a condition that any record with buschl 105 is negative and any record with buschl 20 is positive. i don't have any idea to solve this with one sort or icetool step. think i have to do it in more than one step.
Hope my bad english is good enough to discribe my task?!
//*====================================================================
//PREPARE EXEC PGM=SYNCSORT
//*
//SYSOUT DD SYSOUT=*
//*
//SYMNAMES DD *
NUM_VNR,25,4,BI
BUDAT,37,10,CH
BETRAG,47,9,ZD
BUSCHL,59,2,BI
IN_NUM,1,8,ZD
IN_BUD,10,10,CH
IN_BET,21,11,SFF
IN_BUS,33,3,SFF
//*
//SORTIN DD *
00000001 1111-11-11 -1111111.22 20
82116403 2019-01-20 -0000061.69 20
82308036 2019-03-20 +0000125.28 20
82308036 2019-02-20 +0000125.28 20
82308036 2019-01-20 +0000125.28 20
82308036 2019-12-01 -0000125.28 105
83669658 2019-01-20 +0000402.80 20
84304455 2019-12-01 +0000204.00 100
85601898 2019-12-01 +0001279.32 100
85623651 2019-01-20 -0000044.40 20
85623651 2019-12-01 +0000044.40 105
85623651 2019-01-20 +0000444.40 20
85623651 2019-01-20 +0000444.40 20
85623651 2019-12-01 -0000444.40 105
85623651 2019-01-20 +0044444.40 100
85770501 2019-01-20 +0000018.00 20
//*-+----1----+----2----+----3----+----4----+----5----+----6----+----7
//*
//SORTOUT DD DISP=(NEW,PASS),DSN=&&REALDATA,
// SPACE=(TRK,(10,10),RLSE)
//*
//SYSIN DD *
INREC BUILD=(NUM_VNR:IN_NUM,TO=BI,LENGTH=4,
BUDAT:IN_BUD,
BETRAG:IN_BET,TO=ZDC,LENGTH=9,
BUSCHL:IN_BUS,TO=BI,LENGTH=2,
80:X)
SORT FIELDS=COPY
//*
//*====================================================================
//SORTMISM EXEC PGM=SYNCTOOL,COND=(0,NE)
//*
//SYMNAMES DD *
NUM_VNR,25,4,BI
BUDAT,37,10,CH
BETRAG,47,9,ZD
BUSCHL,59,2,BI
RECIN,1,80
RECEND,*
*
REBETRAG,*,9,ZD
SKIP,1
RENUM,*,8,ZD
SKIP,1
REBUSCHL,*,3,ZD
SKIP,1
SEQNO,*,5,ZD
*
POSITION,RECEND
IDKEY,*,28,BI
*
//*
//TOOLMSG DD SYSOUT=*
//SSMSG DD SYSOUT=*
//SORTIN DD DISP=(OLD,DELETE),DSN=&&REALDATA
//*
//REC105 DD SPACE=(TRK,(20,20))
//RECS DD SPACE=(TRK,(20,20))
//DEBUG DD SYSOUT=*
//*
//SORTOUT DD SYSOUT=*
//*....................................................................
//TOOLIN DD *
SORT FROM(SORTIN) TO(RECS,REC105) USING(SPLT)
COPY JKFROM TO(SORTOUT) USING(SEPR)
//*....................................................................
//SPLTCNTL DD *
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,80,
REBETRAG:BETRAG,MUL,-1,TO=ZDC,LENGTH=9,
RENUM:NUM_VNR,TO=ZDF,LENGTH=8,
REBUSCHL:BUSCHL,TO=ZDF,LENGTH=3)),
IFTHEN=(WHEN=(BUSCHL,NE,+105),
OVERLAY=(REBETRAG:BETRAG,TO=ZDC,LENGTH=9))
SORT FIELDS=(NUM_VNR,A,
REBETRAG,A)
OUTREC IFTHEN=(WHEN=GROUP,
KEYBEGIN=(IDKEY),
PUSH=(SEQNO:SEQ=5))
OUTFIL FNAMES=(REC105),
INCLUDE=(BUSCHL,EQ,+105)
OUTFIL FNAMES=(RECS),
INCLUDE=(BUSCHL,NE,+105)
//*
//SEPRCNTL DD *
JOINKEYS F1=RECS,
FIELDS=(BETRAG,A, REAL AMOUNT
RENUM,A, ACCOUNT NUMBER
SEQNO,A) DUPLICATE NUMBER
JOINKEYS F2=REC105,
FIELDS=(REBETRAG,A, INVERTED AMOUNT
RENUM,A, ACCOUNT NUMBER
SEQNO,A) DUPLICATE NUMBER
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:RECIN)
//*
//*====================================================================