SET STAY

Read syntax diagramSkip visual syntax diagram SET STAY ONOFF

Purpose

Use the STAY option to specify whether the line pointer is to move when a string that is the object of a LOCATE target search, FIND, FINDUP, NFIND, or NFINDUP is not found. Also, use the STAY option to specify whether the line pointer is to move when a string that is the object of the target search with CHANGE, COUNT, COMPRESS, EXPAND, LOWERCAS, SET SELECT, SHIFT, or UPPERCAS is found.

Operands

ON
specifies the line pointer is not to move.
OFF
specifies the line pointer moves.

Initial Setting

STAY  OFF

Usage Notes

  1. SET STAY applies to LOCATE target searches and FIND family searches issued to the end of file (or end of range). With SET STAY OFF, the null End of File (or End of Range) line becomes the new current line if a search is unsuccessful. The Top of File (or Top of Range) line becomes the new current line if the search was in a backward direction. With SET STAY ON, the current line remains the same.
  2. SET STAY also applies to the following subcommands: CHANGE, COUNT, COMPRESS, EXPAND, LOWERCAS, SET SELECT, SHIFT, and UPPERCAS. With SET STAY OFF, the last line examined or acted upon becomes the new current line; with SET STAY ON, the line pointer does not move when the subcommand is executed.

Messages and Return Codes

520E
Invalid operand: operand [RC=5]
545E
Missing operand(s) [RC=5]

where return codes are:

0
Normal
5
Invalid or missing operand(s)
6
Subcommand rejected in the profile due to LOAD error, or QUIT subcommand has been issued in a macro called from the last file in the ring