Monday, 28 July 2014

COBOL File Status.

The FILE STATUS clause can be used with a SELECT statment for determining the result of an input/output file operation. If an input or output error has occur, the file STATUS filed indicate the specific type of error. 

When the FILE STATUS clause is specified, the system moves a value into the two byte alphanumeric data-name defined in the WORKING-STORAGE SECTION after each input-output operation that explicitly or implicitly refers to this file. 

Format :

The value indicates the status of execution of the statement. It is a very good practice to code the FILE STATUS clause for every file.

Example :

Created with Artisteer

No comments:

Post a comment