Joined: 03 Sep 2020
|I am reading few VSAM files to populate few fields in DB2. In case of any issue in reading the files , i should not terminate the process. The expectation is to handle the abend so that I do not abend and populate the field with SPACES.
I have been asked to used HANDLE ABEND in this situation but not sure how to incorporate it as it behaves like a GO TO statement with no control being returned.
I am using the below approach using the RESP, wherein i move value from file if RESP code is 0 . Any other RESP code I move SPACES to the field . Do you think it will suffice?
EXEC CICS READ
KEYLENGTH (LENGTH OF FILE-KEY)
IF WS-RESP = 0
MOVE DATA-FLD TO WS-FLD
MOVE SPACES TO WS-FLD