Note that if the search specification is not wildcarded, F$SEARCH will return the same string over and over. The example shows how to avoid locked loops by saving the filespec after each invocation and comparing the previous string to the current string. If they match, exit the loop.