COBOL · File status code

File Status 05

What does File Status 05 mean in COBOL?

The file was declared with the OPTIONAL phrase in SELECT, and the OPEN found no file present at the assigned location.

File Status 05IBM Enterprise COBOL · Micro Focus · GnuCOBOL

Condition

The file was declared with the OPTIONAL phrase in SELECT, and the OPEN found no file present at the assigned location.

Fix

This is informational, not an error, if your program is written to handle a missing optional file. Confirm your OPEN logic branches correctly on status 05 instead of falling through to file-not-found handling meant for status 35.

Pending source verification. Not yet checked against official documentation.

Related file status code