b = locate(dictionary_name,relational_operator,key_prefix);
function finds, but does not load, a case in a data file that matches a specified condition. The function searches the index of a file and finds the first case that matches the specified condition. The case pointer is positioned to the case's location, but the case is not loaded into memory. To load the case into memory, use the the retrieve
function or the loadcase
function without parameters.
refers to either an external dictionary or the main input file of a batch application. If referencing the main input file of a batch application, you must run your program in indexed order
The relational_operator is one of the following: =, <, <=, >, or >=.
The string expression key_prefix
specifies the condition to use when searching for cases. Cases with a key
that begins with or equals the key_prefix
are considered eligible cases. If the relational operators are < or <=, then the file is positioned at the case with the largest key which satisfies the condition. If the relational operators are > or >=, then the file is positioned at the case with the smallest key which satisfies the condition.
The function returns a logical value of 1 (true) if a case is found and 0 (false) otherwise.