You are here: Command Parameters > Next

Next

Next is a scope parameter that causes a command to be executed on a number of records, starting at the current record. Processing terminates after the specified number of records has been reached. Next is dependent on current record position.

After execution of a command containing a Next parameter, the record position is set at the record immediately following the number of records specified in the command. If the end of the file was reached during execution, the record position will be reset to record 1.

Note: Because Next causes an early termination of processing, it cannot be used within a Group command, although it can be used in the outermost Group command of a set of nested Groups.

The Next parameter can also be used in conjunction with the If or While parameters. The Next clause is applied first, independently of the If test. If both While and Next are specified in the same command, the record position is determined by the first of the two clauses to terminate processing.

Command Mode Syntax

NEXT n

In the following example, Next causes the command to terminate after 10 records:

TOTAL ALL NEXT 10

The record position is set at the first record after 10 records have been processed. For example, if the record position was 2 at the start of the above command, it will be positioned at 12 after the command has been executed.

Command Dialog Box

The Next option is available by clicking the [More] button in most command dialogs. Simply click the “Limit Processing To” pull-down, select Next and then specify the number of records in the adjacent text box.

Simply enter the number of records to process from the current record.