%FOUND Function
%FOUND built-in function returns True if the most recent relevant file operation found a record, a string operation found a match, or a search operation found an element. Otherwise, this function returns False.
%FOUND {(File_name)}
Parameters
File_name
Optional. The name of the file.
- If the file _ name parameter is not specified, then it returns the value set for the most recent relevant operation.
- If the file _ name parameter is specified, then it applies to the most recent relevant operation on that file.
Remarks
For file operations, % FOUND is opposite in function to the “no record found NR” indicator, or the NotFnd parameter.
For string operations, % FOUND is the same in function as the “found FD” indicator, or the Fnd parameter.
For the LOOKUP operation, % FOUND returns True if the operation found an element satisfying the search conditions.
The operations that set %FOUND are:
File operations:
- CHAIN (Random Retrieval from a File)
- DELETE (Delete Record)
- SETGT (Set Greater Than)
- SETLL (Set Lower Limit)
String operations:
Built-in function %SCAN does not change the value of %FOUND .
Search operations:
- LOOKUP (Look Up a Table or Array Element)