I have 2 files, i need to compare and remove the odd value and write to other file.
eg:
file1
aaa
bbb
file2
aaa
ccc
bbb
output should be ccc
i have written the below code :
Z= 0
ADDRESS TSO
"ALLOC FI(IN) DA('"inp1"') SHR"
"EXECIO * DISKR IN(FINIS STEM INP."
"FREE FI(IN)"
"ALLOC FI(INS) DA('"inp2"') SHR"
"EXECIO * DISKR INS(FINIS STEM INP1."
"FREE FI(INS)"
DO I = 1 TO INP.0
DO J =1 TO INP1.0
FLAG = 1
INP1.J = STRIP(INP1.J)
INP.I = STRIP(INP.I)
IF INP.I = INP1.J THEN
DO
FLAG = 0
END
END
IF FLAG = 1 THEN
DO
OUT.Z = INP.I
Z = Z + 1
END
END
ADDRESS TSO
"ALLOC FI(ERRFL) DA('"output"') SHR"
"EXECIO * DISKW ERRFL (FINIS STEM OUT."
"FREE FI(ERRFL)"
ADDRESS TSO
"ALLOC FI(IN) DA('"inp1"') SHR"
"EXECIO * DISKR IN(FINIS STEM INP."
"FREE FI(IN)"
"ALLOC FI(INS) DA('"inp2"') SHR"
"EXECIO * DISKR INS(FINIS STEM INP1."
"FREE FI(INS)"
DO I = 1 TO INP.0
DO J =1 TO INP1.0
FLAG = 1
INP1.J = STRIP(INP1.J)
INP.I = STRIP(INP.I)
IF INP.I = INP1.J THEN
DO
FLAG = 0
END
END
IF FLAG = 1 THEN
DO
OUT.Z = INP.I
Z = Z + 1
END
END
ADDRESS TSO
"ALLOC FI(ERRFL) DA('"output"') SHR"
"EXECIO * DISKW ERRFL (FINIS STEM OUT."
"FREE FI(ERRFL)"
can someone please tell me what is the mistake in this.