The STATUS statement and STATUS() function return control information from an interface or an I/O Path status register. Using the STATUS statement, the values of several status registers are copied into a list of numeric variables, starting at the specified register number and continuing until the variable list is exhausted. If it is not specified, the starting register number is zero. For example:
STATUS 2;Column,Line
This reads two values from interface number 2: Column receives the value of status register 0, and Line receives the value of status register 1.
The STATUS() function as opposed to the STATUS statement allows immediate access to a single register without need for a temporary variable or separate STATUS statement. However, the STATUS() function can only return the value of one register at a time, while the STATUS statement can return the values of multiple registers in a single statement.
An example of the STATUS function:
Column=STATUS(2,0)
This reads the status of register 0 from interface number 2 and assgins it to the variable Column.
The CONTROL and STATUS registers for I/O paths assigned to devices, files and buffers are described in the following paragraphs.
|