NEXT


The NEXT command relocates the display to the segment following the currently displayed data in the same record. Use this command only when editing segmented records. Use the NEXT command without parameters to move to the next segment that matches any record layout (subject to XREF constraints) within the current record.

The command is available in the Browse and Edit functions in Formatted mode.

image2021-6-4_9-51-21.png

n

Specifies the number of segments to advance the display. The default for the n parameter is 1 (advance one segment).

record-layout

Specifies that a segment matching the XREF criteria for the specified record layout is to be displayed. If the specified record layout does not match the name of a currently loaded record layout, the message RECORD LAYOUT NOT FOUND is displayed.

Use of NEXT with an XREF

The NEXT command is affected by the XREF for the base segment, which is the first segment in the currently selected record.

  • If a select group is defined for the base segment record type, only subordinate record layouts listed in that select group are used to match subsequent record segments. The subordinate record layouts are categorized as either dependent or independent. In dependent scenarios, the base record layout immediately precedes the subordinate segment layout(s). In independent scenarios, the Base record layout precedes the subordinate record layout but is not required to be immediately preceding, allowing for any SEGMENT layout to be associated with any BASE layout. For more information on base and subordinate segments, XREFs, and select groups, see Segmented Records.
  • If no select group is defined for the base segment record type, File-AID attempts to match subsequent segments using any of the base segment XREFs (that is, those having an absolute location entry).

If a segment is encountered that cannot be matched to an appropriate XREF, further scanning of record segments is interrupted, since the length of the unmatched segment is unknown.

If scanning is interrupted before any segments that match the specified record type have been identified, the display remains at the same segment and produces the error message: NEXT SEGMENT UNKNOWN.

Scanning is interrupted when the end of the record is reached. If no matching segments have been identified, the error message: ALREADY AT LAST SEGMENT is displayed and the same segment remains displayed.

If either an unmappable segment or the end of the record is reached after at least one but less than n segments of the specified type have been identified, the display moves to the last matching segment and produces the error message: NOW AT LAST SEGMENT.

Use of NEXT without an XREF

When there is no XREF in use, no criteria are available to determine the following record segments. Therefore, the currently selected record layout is used to process all following segments. You can change the layout by using the record-layouts parameter on the NEXT command or with the USE command. The n parameter causes the nth segment to be displayed, using the length of the currently selected record layout to skip the intervening segments.

If the end of the record is reached before n segments have been mapped, the error message: NOW AT LAST SEGMENT is displayed and the last full or partial segment is displayed.

If the BOTTOM OF DATA line is present prior to use of the NEXT command, the error message: ALREADY AT LAST SEGMENT is displayed.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*