Search statement considerations
The topic lists considerations of using the SEARCH statement.
Index data items cannot be used as subscripts, because of the restrictions on direct reference to them.
To ensure correct execution of a SEARCH statement for a variable-length table, make sure the object of the OCCURS DEPENDING ON clause (data-name-1) contains a value that specifies the current length of the table.
The scope of a SEARCH statement can be terminated by any of the following items:
- An END-SEARCH phrase at the same level of nesting
- A separator period
- An ELSE or END-IF phrase associated with a previous IF statement