Highlighted
Honored Contributor.
Honored Contributor.
1290 views

File Status Code 05

Jump to solution

This is not a big deal, but I have an Indexed File that is NOT described as OPTIONAL in the SELECT statement.

When I OPEN the file I-O,  and the file is not there, it creates an empty file (good!  that's what I want!) and returns a status code of 05 (instead of 35).

I would have thought that the status code would have been a 35 in this instance (as it is NOT described as an optional file).

So, my only question is why is it 05 instead of 35 in this case?

Thanks.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: File Status Code 05

Jump to solution

Hi Austin1, this behavior depends on the setting of the OPTIONAL-FILE directive.  By default this directive is set on, giving the behavior you've observed, i.e. an OPEN I-O or OPEN EXTEND on a file that does not exist will create the file, returning a status of 05.

If you compile the program with the directive NOOPTIONAL-FILE, the OPEN I-O on a non-existent file will NOT create the file and will return a status of 35.

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: File Status Code 05

Jump to solution

Hi Austin1, this behavior depends on the setting of the OPTIONAL-FILE directive.  By default this directive is set on, giving the behavior you've observed, i.e. an OPEN I-O or OPEN EXTEND on a file that does not exist will create the file, returning a status of 05.

If you compile the program with the directive NOOPTIONAL-FILE, the OPEN I-O on a non-existent file will NOT create the file and will return a status of 35.

View solution in original post

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

RE: File Status Code 05

Jump to solution

Thanks!

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.