NEXT primary command

The NEXT primary command uses the parameters supplied to scroll the current database position to the next occurrence of a segment type.

Syntax


1 NExt? number
1! =
1 *
1 segment-name
1 MAX
number
The number of segment occurrences you move forward.
=
Behavior depends on the current SHOW command settings.

If the current setting is SHOW SUP OFF, FM/IMS scrolls forward to the nth occurrence of the same segment and layout type (the currently formatted segment type).

If the current setting is SHOW SUP ON, FM/IMS scrolls forward to the nth occurrence of the same segment type as the current segment, regardless of the layout type.

Note: = is the default unless the Use * (any segment type) as default on NEXT and PREVIOUS commands field in the Editor Options panel (option 0.5) has been selected.
*
Ignore the current SHOW command settings and move forward the number of segment occurrences irrespective of segment type.
Note: This can be made the default behavior by selecting the Use * (any segment type) as default on NEXT and PREVIOUS commands field in the Editor Options panel (option 0.5).
segment-name
Move forward to the nth occurrence of specified segment type.
Note:
  1. If FM/IMS doesn't find an exact match for segment-name within the DBD, it searches the list of segments in the DBD to determine if any of the segment names contain the value entered. The first segment name that contains a match is used with the NEXT command. For example:
                    ACCOUNTS
                       │
         ┌─────────────┴───────────────────┐
         │                                 │
      BRANCH                            CUSTOMER
                                           │
                                        CUSTADDR

    Entering 'NEXT CUST' would position on the next occurrence of the CUSTOMER segment in the database but would not find the CUSTADDR segment. However, you could enter 'NEXT ADDR' and this would retrieve the next occurrence of the CUSTADDR segment in the database.

  2. If the specified segment occurrence is not found, the current database position is unchanged and the following message is displayed: Invalid segment name
MAX
Scrolls to last segment. You can also enter MAX in the scroll field and then enter the NEXT command.
Note: The scroll field does not change the default to MAX.

Availability

Related tasks and examples

PREVIOUS primary command