I have a SALARY field of S9(13)V99 COMP-3 in a VSAM file.
The requirement is to find all the customer details whose SALARY is more than 20000. I tried to run with the below code, but its failing for SOC7. Could you please help in resolving the issue?
FILE FILE2 VS
F2-CUSTID 1 8 P
F2-ACCNO 10 4 P
F2-SAL 73 8 P 2
FILE OUTFILE FB(80 0)
OUT-CUSTID 1 8 P
OUT-ACCNO 20 4 P
JOB INPUT NULL
GET FILE2
DO WHILE NOT EOF FILE2
IF F2-WORK GET X'20000'
MOVE F2-CUSTID TO OUT-CUSTID
MOVE F2-ACCNO TO OUT-ACCNO
PUT OUTFILE
END-IF
GET FILE2
END-DO
STOP
F2-CUSTID 1 8 P
F2-ACCNO 10 4 P
F2-SAL 73 8 P 2
FILE OUTFILE FB(80 0)
OUT-CUSTID 1 8 P
OUT-ACCNO 20 4 P
JOB INPUT NULL
GET FILE2
DO WHILE NOT EOF FILE2
IF F2-WORK GET X'20000'
MOVE F2-CUSTID TO OUT-CUSTID
MOVE F2-ACCNO TO OUT-ACCNO
PUT OUTFILE
END-IF
GET FILE2
END-DO
STOP