PREVIOUS primary command

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

Syntax


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

If the current setting is SHOW SUP OFF, FM/IMS scrolls back to the nnnnth occurrence of the same segment type from the current database position (that is, the currently formatted segment type).

If the current setting is SHOW SUP ON, FM/IMS scrolls back the number of segment occurrences regardless of the segment type.

*
An * ignores the current SHOW command settings and move back the number of segment occurrences irrespective of segment type.
Note: An = is the default unless the option Use * (any segment type) as default on NEXT and PREVIOUS commands, set in option 0.5 (Editor Options).
segment-name
Move back 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 PREV command. For example:
                    ACCOUNTS
                       │
         ┌─────────────┴───────────────────┐
         │                                 │
      BRANCH                            CUSTOMER
                                           │
                                        CUSTADDR

    Entering 'PREV CUST' would position on the previous occurrence of the CUSTOMER segment in the database but would not find the CUSTADDR segment. However, you could enter 'PREV ADDR' and this would retrieve the previous 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
  3. If a sliding window is used the following message is displayed: Segment not in window
  4. If a sliding window has been used for the edit/browse display, the current top of the window is the limit to which the PREVIOUS command can move the database position.
MAX
Scrolls to first 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

NEXT primary command