If you want to do it with the INVALID KEY, then you have to set a "flag" or "marker".
MOVE "I" TO W-VALID-INVALID-FLAG
NOT INVALID KEY
MOVE "V" TO W-VALID-INVALID-FLAG
Then you can have an 88 on the flag, and use the 88 in a "compound" IF or a "nested" IF.
Using file status instead of INVALID KEY and it would be fine with an 88 on the file status field.
Note, you can use the SET verb in place of the move, by changing the name of the flag to the name of the 88 that you use for the value:
SET W-KEYED-READ-INVALID TO TRUE
SET W-KEYED-READ-VALID TO TRUE