ILE COBOL Language Reference


FILE STATUS Clause

The FILE STATUS clause monitors the execution of each input-output request for the file.

FILE STATUS Clause - Format
 
>>-+------+--STATUS--+----+--data-name-1------------------------>
   '-FILE-'          '-IS-'
 
>--+------------------+----------------------------------------><
   |             (1)  |
   '-data-name-5------'
 
 

Notes:

  1. IBM Extension

When the FILE STATUS clause is specified, the system moves a value into the status key data item after each input-output request that explicitly or implicitly refers to this file. The value indicates the status of execution of the statement. (See the "Status Key" description under Common Processing Facilities.)

When the compiler generates code to block output records or unblock input records, file status values that are caused by operating system exceptions are set only when a block is processed. See Appendix F, File Structure Support Summary and Status Key Values for a description of the possible values. See the ILE COBOL for AS/400 Programmer's Guide for more information on blocking output records and unblocking input records.

data-name-1
The status key data item must be defined in the Data Division as a 2-character alphanumeric item. Data-name-1 must not be defined in the File Section. Data-name-1 can be qualified.

+-------------------------------IBM Extension--------------------------------+

data-name-5
An optional status key data item may be specified for file processing.

For transaction files, the data item must be a 4-character alphanumeric item.

For non-transaction files, the data item must be a 6-byte group item. The item is treated as documentation for all non-transaction files except for those that are dynamically created. Extended file status is set to 0900 for files that are created dynamically when OPEN OUTPUT is specified. Data-name-5 can be qualified.

+----------------------------End of IBM Extension----------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]