%EQUAL{(file_name)}
%EQUAL returns '1' if the most recent relevant operation found an exact match; otherwise, it returns '0'.
The operations that set %EQUAL are:
If %EQUAL is used without the optional file_name parameter, then it returns the value set for the most recent relevant operation.
For the SETLL operation, this function returns '1' if a record is present whose key or relative record number is equal to the search argument.
For the LOOKUP operation with the EQ indicator specified, this function returns '1' if an element is found that exactly matches the search argument.
If a file name is specified, this function applies to the most recent SETLL operation for the specified file. This function is allowed only for files that allow the SETLL operation code.
For more examples, see Figure 332 and Figure 378.
For more information, see File Operations, Result Operations, or Built-in Functions.
*..1....+....2....+....3....+....4....+....5....+....6....+....7...+....
F*Filename+IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++
* File CUSTS has record format CUSTREC
FCUSTSIF E K DISK
/FREE
// Check if the file contains a record with a key matching Cust
setll Cust CustRec;
if %equal;
// an exact match was found in the file
endif;
/END-FREE
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
D TabNames S 10A DIM(5) CTDATA ASCEND
D SearchName S 10A
* Position the table at or near SearchName
* Here are the results of this program for different values
* of SearchName:
* SearchName | DSPLY
* -------------+-------------------------------
* 'Catherine ' | 'Next greater Martha'
* 'Andrea ' | 'Exact Andrea'
* 'Thomas ' | 'Not found Thomas'
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
C SearchName LOOKUP TabNames 10 10
C SELECT
C WHEN %EQUAL
* An exact match was found
C 'Exact 'DSPLY TabNames
C WHEN %FOUND
* A name was found greater than SearchName
C 'Next greater'DSPLY TabNames
C OTHER
* Not found. SearchName is greater than all the names in the table
C 'Not found 'DSPLY SearchName
C ENDSL
C RETURN
**CTDATA TabNames
Alexander
Andrea
Bohdan
Martha
Samuel