Check sum of two fields in same record using JCL
I want to put a check in the JCl such that if the value of the sum of the second and fourth field is greater than 0
only then it should be copied to the output file.
For example Suppose my Input file is :
INPUT FILE
A 001 000 000 ---> Rec1
B 000 000 000 ---> Rec2
C 00-1 000 001 ---> Rec3
D 000 000 001 ---> Rec4
in ---> Rec1 A 001 000 000
001 + 000 = 1 >0 hence it should be copied.
B 000 000 000 ---> Rec2
000 + 000 = 0 hence Skip
C 00-1 000 001 ---> Rec3
00 -1 + 001 = 0 Hence Skip
D 000 000 001 ---> Rec4
000 + 001 = 1 Hence Copy.
Out file
OUTPUT FILE
A 001 000 000
D 000 000 001
Could you please help