For a specified segment and each of its descendants, the REPOSITION command resets the current position to the beginning of chain for that segment. That is, each segment is reset to just prior to the first instance.
Most data source commands change the current segment position to the instance that they most recently accessed. When you wish to search an entire data source or path for records, start at the beginning of the data source or path by first issuing the REPOSITION command.
The syntax of the REPOSITION command is
REPOSITION segment_spec [;]
Is the name of a segment or the name of a field in a segment. The specified segment and all of its descendants are repositioned to the beginning of the segment chain.
Terminates the command. Although the semicolon is optional, you should include it to allow for flexible syntax and better processing. For more information about the benefits of including the semicolon, see Terminating Command Syntax.
The following example repositions the root segment and all of the descendant segments of the Employee data source:
The next example repositions both the SalInfo and Deduct segments in the Employee data source: