I am trying to select the matching records from the vsam file based on the key.
Its numeric of 12 length. When I run this program...it does not return any error. But for some reasons, its not able to match any records from the VSAM file (but there are matching records).
key in the vsam file:
sort code 6
account number 8
seq no 1
account number 8
seq no 1
It displays in the log as
example:
121212121212NOT FOUND
141212121212NOT FOUND
121312121212NOT FOUND
141212121212NOT FOUND
121312121212NOT FOUND
Could you please advise what could be problem?
//SYSIN DD *
LIST ON
FILE FILE1 FB(80 *)
IN-REC 1 80 A
IN-KEY 1 15 A
FILE FILE2 VS
F2-REC 1 124 A
F2-KEY 1 15 A
F2-VALUE 16 30 A
FILE OUTFILE FB(80 *)
OUT-REC 1 80 A
OUT-KEY 1 15 A
OUT-VALUE 20 30 A
JOB INPUT NULL
GET FILE1
DO WHILE NOT EOF FILE1
READ FILE2 KEY IN-KEY STATUS
IF FILE2 : FILE-STATUS EQ 0
MOVE IN-KEY TO OUT-KEY
MOVE F2-VALUE TO OUT-VALUE
PUT OUTFILE
ELSE
DISPLAY IN-KEY ' NOT FOUND'
END-IF
GET FILE1
END-DO
STOP
LIST ON
FILE FILE1 FB(80 *)
IN-REC 1 80 A
IN-KEY 1 15 A
FILE FILE2 VS
F2-REC 1 124 A
F2-KEY 1 15 A
F2-VALUE 16 30 A
FILE OUTFILE FB(80 *)
OUT-REC 1 80 A
OUT-KEY 1 15 A
OUT-VALUE 20 30 A
JOB INPUT NULL
GET FILE1
DO WHILE NOT EOF FILE1
READ FILE2 KEY IN-KEY STATUS
IF FILE2 : FILE-STATUS EQ 0
MOVE IN-KEY TO OUT-KEY
MOVE F2-VALUE TO OUT-VALUE
PUT OUTFILE
ELSE
DISPLAY IN-KEY ' NOT FOUND'
END-IF
GET FILE1
END-DO
STOP
Code'd