I/O Status

After the execution of any file I/O verb (CLOSE, DELETE, OPEN, READ, REWRITE, START, UNLOCK, or WRITE), information about the I/O is available in the form of a status number. This number is placed in the FILE STATUS variable for the appropriate file if one has been declared.

status-variable must be the name of an alphanumeric (or USAGE DISPLAY numeric) Working-Storage or Linkage data item with a size of 2 characters. (The compiler also allows status-variable to be a numeric item; however, in this case it emits a Warning.) The first digit indicates a general classification of the status, while the second digit provides detail information. Any file status whose first digit is 0 is considered a successful I/O. Any non-zero initial digit indicates failure.