PORYES
New User
Joined: 04 Apr 2007 Posts: 38 Location: Chennai
|
|
|
|
Hi -
My input file hasthe below values.
----+----1----+----2
********************
ID AMT
1020 +10
1020 -10
1021 +5
1021 -5
1021 -8
1021 -1
1035 -5
1035 +5
1035 -2
1035 +2
My requirement is to check which ID values are NOT net Zero.
Eg: If we check the ID: 1020 and sum the amount the value should be zero.
For ID: 1021, Sum of the amounts are not Zero.
If the values are not zero, then display the ID.
Can anyone please help. |
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1335 Location: Bamberg, Germany
|
|
|
|
Code: |
//EXPERT EXEC PGM=SORT
//SORTIN DD *
1020 +10
1020 -10
1021 +5
1021 -5
1021 -8
1021 -1
1035 -5
1035 +5
1035 -2
1035 +2
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(41:6,8,SFF,TO=ZD,LENGTH=8))
SORT FIELDS=(1,4,ZD,A)
SUM FIELDS=(41,8,ZD)
OUTFIL FNAMES=(SORTOUT),
INCLUDE=(41,8,ZD,NE,+0),
REMOVECC,
BUILD=(1,4,X,41,8,ZD,M25,SIGNS=(+,-),LENGTH=9)
END
/* |
Output:
|
|