i = seek (multiple_item condition[,numeric_expr]);
The seek function returns the occurrence number of the first item in a multiply-occurring item that satisfies the given condition. If numeric_expr is included, the function starts searching the multiply-occurring record for a true condition starting at occurrence numeric_expr. If an @ symbol precedes the numeric_expr, the function searches for the nth occurrence of the condition.
The function returns the occurrence number of an item that meets the condition. If no item is found it returns 0.
PROC PERSON_ROSTER
numeric femaleIndex = seek(SEX = 2);
while femaleIndex do
write("Person #%d is a female with name '%s'",femaleIndex,NAME(femaleIndex));
femaleIndex = seek(SEX = 2,femaleIndex + 1);
enddo;
numeric firstFemaleOver15 = seek(SEX=2 and AGE >= 15); // multiple conditions can be given