NEXT (Next)

Free-Form Syntax NEXT{(E)} program-device file-name
Code Factor 1 Factor 2 Result Field Indicators
NEXT (E) program-device file-name _ ER _

The NEXT operation code forces the next input for a multiple device file to come from the program device specified by the program-device operand, 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.

For the program-device operand, enter the name of a 10-character field that contains the program device name, a character literal, or named constant that is the program device name. The file-name operand is the name of the multiple device WORKSTN file for which the operation is requested.

To handle NEXT exceptions (file status codes greater than 1000), either the operation code extender 'E' or an error indicator ER can be specified, but not both. For more information on error handling, see File Exception/Errors.

For more information, see File Operations.

Figure 356. NEXT Operations
*...1....+....2....+....3....+....4....+....5....+....6....+....7....+....
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
C
 * Assume devices Dev1 and Dev2  are connected to the WORKSTN file
 * DEVICEFILE. The first READ reads data from DEV1, the second READ
 * reads data from DEV2. The NEXT operation will direct the program
 * to wait for data from the device specified in factor 1 (i.e. DEV1)
 * for the third READ.
C
C                   READ (E)  Devicefile
C                   :
C                   READ (E)  Devicefile
C                   :
C     'DEV1'        NEXT
C                   :
C                   READ (E)  Devicefile                             


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