If you do not specify any operands, the operands you specified
last with FIND are used. The search for the specified string begins
at the line following the current line. If you issue the TOP subcommand,
the search for the specified string begins with the second line of
the data set. Successive use of the FIND subcommand without operands
allows you to search a data set, line by line.
- string
- specifies the sequence of characters (the character string)
that you want to locate. You must precede this sequence of characters
with an extra character that serves as a special delimiter. The extra
character can be any printable character other than
a number, apostrophe, semicolon, blank, tab, comma, parenthesis, or
asterisk. Do not use the extra character in the character string
or put a delimiter between the extra character and the string of characters.
Instead
of using special delimiters to indicate a character string, you can
use paired single quotation marks (apostrophes) to accomplish the
same function with the FIND subcommand. The use of single quotation
marks as delimiters for a character string is called quoted-string
notation. Following are the rules for quoted-string notation for
the string operand:
- Enclose a string within single quotation marks; for example, ‘string character’.
- Use two single quotation marks to represent a single quotation
mark within a character string; for example, ‘pilgrims's progress’.
- Use two single quotation marks to represent a null string; for
example, ".
- position
- specifies the column within each line at which you want the
comparison for the string to be made. This operand specifies the
starting column of the field to which the string is compared in each
line. If you want to consider a string starting in column 6, you
must specify the digit 6 for the position operand. For COBOL data
sets, the starting column is calculated from the end of the six-digit
line number. If you want to consider a string starting in column 8,
you must specify the digit 2 for this operand. When you use this
operand with the special-delimiter form of notation for string, you
must separate it from the string operand with the same special delimiter
as the one preceding the string operand.