RPG/400 Help

NEXT (Next)

*---------*---------------*-----------------*----------------*---------------*
|   CODE  |    FACTOR 1   |     FACTOR 2    |     RESULT     |  INDICATORS   |
|         |               |                 |      FIELD     |               |
*---------*---------------*-----------------*----------------*---------------*
| NEXT    | Program       | File name       |                |    _ ER _     |
|         | device        |                 |                |               |
*---------*---------------*-----------------*----------------*---------------*

The NEXT operation code forces the next input for a multiple device file to come from the program device specified in factor 1, providing the input operation is a cycle read or a READ-by-file-name. Any read operation, including CHAIN, EXFMT, READ, and READC, ends the effect of the previous NEXT operation. If NEXT is specified more than once between input operations, only the last operation is processed. The NEXT operation code can be used only for a multiple device file.

In factor 1, enter the name of a 10-character field that contains the program device name or a character literal or named constant that is the program device name. In factor 2, enter the name of the multiple device WORKSTN file for which the operation is requested.

You can specify an indicator in positions 56 and 57. It is set on if an exception/error occurs on the NEXT operation. If the INFSR subroutine is specified and positions 56 and 57 do not contain an indicator, the subroutine automatically receives control when an exception/error occurs. If the INFSR subroutine is not specified and positions 56 and 57 do not contain an indicator, the default error handler takes control.


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