Returns the next subscripted local or global variable name in collation sequence within the array level specified by its argument.

$NEXT() has been replaced by $ORDER(). $NEXT has been retained in the current standard only for compatibility with earlier versions of the standard. $NEXT() is similar to $ORDER(). However, $NEXT() has the deficiency that when it encounters negative one (-1) as a subscript, it returns the same result as when it finds no other data at the level. This deficiency is particularly disruptive because it occurs in the middle of the M collating sequence.

[Caution] Caution

As $NEXT() has been removed from the standard in the MDC, you should use $ORDER.

The format for the $NEXT function is: