FIND (F)


The FIND command searches for and displays, if found, lines meeting specified conditions. When you enter the FIND command without parameters, File-AID displays the FIND Command screen. The screen field names are shown in parentheses next to their corresponding parameter terms.

The command is available in the Browse and Edit functions in all modes.

image2021-6-3_11-29-22.png

rel (Operator)

Relational operator that specifies the relationship the data must have to the val1 parameter in order to be found. Valid entries for this parameter are:

EQ

Matches any string equal to val1 (default)

NE

Matches any string not equal to val1

LT

Matches any string less than val1

GT

Matches any string greater than val1

LE

Matches any string less than or equal to val1

GE

Matches any string greater than or equal to val1.

The rel parameter may be used with a val1 parameter (or a substitute asterisk), but not with the parameters VALID and INVALID. When val1 is a character string, the comparison is executed according to the EBCDIC collating sequence.

val1 (Find string)

Provides a value to be matched using the comparison specified by the rel parameter. When used with a /field-name or /field-number parameter, val1 is required to be compatible with the field declaration in the record layout.File-AID does not perform any case conversion for DBCS (double byte character set) data.

The val1 parameter may be any one of the following data types:

Simple string

An alphanumeric character string that does not contain any single quotes ('), double quotes ( " ), imbedded blanks, or commas.

Delimited string

A simple string enclosed in single (') or double (") quotation marks. Use delimited strings to search for characters that are not allowed in simple strings and in some instances, to enclose command keywords.

Simple and delimited strings are not case sensitive. Specify any combination of upper and lowercase characters for the search string and, regardless of the case, any combination of the specified characters is found. For example:

FIND oak

finds the next occurrence of the character string 'oak', 'Oak', or 'OAK', for example, regardless of case.

FIND oak all or FIND OAK ALL

finds all occurrences of the character string 'oak' regardless of case.

To find all occurrences of a string that is also a keyword, you must enclose the string in single or double quotes:

FIND ’ALL’ all

finds all occurrences of the character string 'ALL', 'all', or 'All', for example, regardless of case.

FIND ’’’ or FIND "’"

searches for a single quote.

FIND ’"’ or FIND """

searches for a double quote.

Character string

A delimited string of characters preceded by the letter C. A character string does not translate alphabetic characters to uppercase, and matches only an exact duplicate (including case) of the input string.

Hexadecimal string

A delimited string containing an even number of hexadecimal digits (0-9, A-F), preceded by the character X.

Decimal string

A delimited string of decimal digits (0-9) preceded by the letter F or H. The F or H may also be followed by L and a decimal digit to specify the data length (from 1 to 8) in bytes. If the length is omitted, the default value for F is 4, and 2 for H. A decimal string matches the data with the binary representation of the specified string for the specified length.

Packed string

A delimited string of decimal digits preceded by the character P. The P can also be followed by the letter L and a number from 1 to 16 to specify the data length in bytes.

Important

When a packed string is used, the col1 parameter must be specified to indicate the location of the packed data.

File-AID matches only a packed data item of the specified length, beginning in the specified column and including the packed decimal representation of the specified string. If length is omitted, the data matches a valid packed decimal data item with a length of 1 to 16 (containing the specified value).

Packed data test

The characters PL followed by one or two decimal digits to specify the data length (from 1 to 16) in bytes. The col1 parameter must be used to specify the location of the packed data. A packed data test searches for valid packed data starting in the specified column. If length is specified, the data must be a packed decimal number of the specified length. Use the NE relational operator to search for invalid data in a specified column. Only the EQ or NE relational operators may be specified with a packed data test.

Text string

A delimited string preceded by the character T. Text strings are unnecessary because they are treated the same as delimited strings. File-AID supports text strings to maintain consistency with ISPF/PDF.

val1 Parameter Examples shows an example for each data type string.

* (asterisk)

Value for the val1 parameter that specifies File-AID to reuse the last value specified in a CHANGE, EXCLUDE, or FIND command.

VALID, INVALID

Searches for valid or invalid data in a specified field. These values are mutually exclusive with the rel and val1 parameters. Data is considered valid if it conforms to the field declaration in the record layout.

/field-name or /field-number parameter is required when VALID or INVALID is used. If neither is specified, the VALID or INVALID keyword is interpreted as a simple string.

A successful search for valid or invalid data produces the message:

EQ VALID FOUND or EQ INVALID FOUND.

An unsuccessful search produces the message:

NO EQ VALID FOUND or NO EQ INVALID FOUND.

lrange (Start range, End range)

Confines the FIND command to a specified range of lines (records). For the line range limits, use any combination of user-defined labels or line numbers, prefixed by a period.

If a single line label or line number is specified (or the same line is specified twice), the search is confined to the specified line. Line range limits may be specified in any order. The line that occurs first in the data set is considered to be the lower limit of the line range.

Additional line labels may be defined by entering (in the sequence field to the left of the line to be labeled) a string starting with a period followed by one of the letters A through Y.

Line ranges are not valid when browsing a keyed file.

X, NX (Lines to search)

X restricts the FIND command to excluded lines. NX restricts the FIND command to nonexcluded lines. If the lrange parameter is also specified, only excluded (or nonexcluded) lines within the specified line range are scanned.

Use the RFIND primary command to search for subsequent occurrences.

NEXT, PREV, FIRST, LAST, ALL (Modifier)

Use the NEXT, PREV, FIRST, or LAST values to specify the starting point and search direction. The following table summarizes the functions of these parameters.

FIND Command Search Values

Parameter

Search Direction

Origin of Search

NEXT

Forward

Current cursor position

PREV

Backward

Current cursor position

FIRST

Forward

Start of data or specified line range

LAST

Backward

End of data or specified line range


The ALL value searches for all occurrences of the specified data (within the lines defined by the lrange, X, and NX parameters). File-AID displays the total number of occurrences and positions the cursor at the first occurrence (from the beginning of the data set or specified line range).

The ALL value is mutually exclusive with the NEXT, PREV, FIRST, and LAST values. If none of these values is specified and a line range is specified, File-AID assumes a value of FIRST. If neither a line range nor any of these values is specified, File-AID assumes a value of NEXT.

col1col2 (Start column, End column)

Specifies a valid single column (col1) or column range (col1 and col2). File-AID defaults to the current bounds settings if col1 and col2 are not specified. To override the default, specify either a single column or column range. Data specified for a single column must begin at the col1 position. Data specified for a column range must be found within the specified range.

Important

The col2 parameter must follow the col1 parameter.

Specify the col1 and col2 parameters as integers. If the val1 parameter consists of the numbers 0 (zero) through 9, delimit the value of the val1 parameter to distinguish it from the column values. Do not use col1 or col2 when the /field-name or /field-number parameter is used.

/field-name, /field-number (Field name, Field number)

The /field-name parameter specifies the data name given to the field in the record layout. The /field-number parameter specifies the number generated by File-AID for each data name in the record layout. If a name was specified in the record layout data set or XREF data set name fields on the Edit - Data set Specification screen, you can use a /field-name or /field-number parameter to confine the search to a specific data field.

The /field-name or /field-number parameter must be prefixed by a slash (/) to distinguish it from val1 or column range (col1 and col2) parameters. A field name can be fully qualified, partially qualified, or unqualified, but it must be unique. Each unique word of the field name may be abbreviated starting with the first letter. If an abbreviated field name is used, it must be unique. Use a period to delimit levels of qualified names. If several maps are loaded, it may be necessary to include the member name or the 01-level name to uniquely identify a field. If so, precede the field name with the member name and/or 01-level name, also delimited with periods. Specify either a /field-name or /field-number parameter when the VALID/INVALID parameter is used.

A field name value that matches more than one field name in the record produces the message:

AMBIGUOUS FIELD NAME.

A field name value that does not match any layout field produces the message:

FIELD NAME NOT FOUND.

If a record layout was not entered on the Edit screen, specifying a /field-name or /field-number produces the message:

FIELD UNDEFINED - NO MAP.

Important

  1. Use of the /field-name, /field-number parameters is mutually exclusive with use of the col1, col2 parameters.
  2. When you use the /field-name or /field-number parameter with the ALL parameter, File-AID finds the first occurrence of the search string in each field.

All Modes

File-AID performs a search without regard to case (upper/lower) for the CHANGE, FIND, and EXCLUDE primary commands with the following exceptions, in which case File-AID searches for the string exactly as entered:

  • If a case-sensitive search is specified by a delimited string of characters preceded by the character C.
  • When a Boolean operator other than EQ or NE is specified.
  • For a double-byte character string (DBCS) system.

Define data to be searched for either by the rel and val1 parameters or by the VALID or INVALID parameter. If the ALL parameter is used, File-AID displays the total number of occurrences of data that match the specified criteria.

FIND is confined to the range of columns within the edit bounds, except when a column, column range, field name, or field number is specified.

Use the FIND primary command or the F (first), L (last), or S (Show) line commands to redisplay lines previously excluded with the EXCLUDE primary command or the X (exclude) line command. These commands move the indicated lines from the excluded subset to the nonexcluded subset of the data set.

The RFIND primary command continues a forward or backward search at the opposite end of the data set. However, the RFIND command is not confined to the line range specified in a previous FIND command.

After a successful search, File-AID positions the cursor at the beginning of the matching data. Use RFIND to reissue the same FIND command and continue the search in the same direction as the original command. An unsuccessful search through the data set or defined line range produces the message: NO (rel)(val1) FOUND.

After a global search, the cursor is positioned at the first occurrence of the specified data (from the start of the file).

Unicode Considerations

For Unicode data, the FIND command has these restrictions:

  1. Only supports hex format.
  2. The parameters VALID and INVALID are not supported.
  3. In FMT mode and VFMT HEX OFF mode, the cursor does not point to the exact position of the found string.

Formatted Mode

A FIND command entered in Formatted mode performs the same operation on the data set as it would if entered in Character or Vertical Formatted mode.

After the search is executed, File-AID positions the display at the field and record where the cursor would appear if the operation had taken place in Character or Vertical Formatted mode, that is, at the first field of the first record where the specified data was found.

Searches are not automatically confined to the currently selected record. Use line range parameters to restrict searches to the currently selected record.

If the cursor is located within the data area of a field when you press Enter, the search is limited to that field. This technique may be used instead of specifying the /field-name or /field-number parameters.

Edit FIND Screen

If you enter the FIND command without specifying any parameters, File-AID displays the following figure. Refer to the parameter descriptions for  for a complete description of the fields on this screen.

FIND Command Screen

File-AID  -----------------  FIND Command  ------------------------------------
 COMMAND ===>

 Specify FIND operands:
    Operator         ===>          (EQ; NE; LT; GT; LE; GE)
    Find string      ===>
    Modifier         ===> NEXT     (NEXT; ALL; FIRST; LAST; PREV)
    Lines to search  ===>          (NX = Nonexcluded; X = Excluded; Blank = all)


 Specify the Following Fields to Limit the Range of Search for this FIND:
     Field name     ===>
        or
     Field number   ===>
        or
     Start column   ===>         End column ===>          (Column number(s))
     Start range    ===>         End range  ===>          (Label or line number)


 NOTE: You may bypass this screen by entering the FIND command with operands:
 FIND   string         (NEXT)    (NX)   (col-1 (col-2))   (range)
 F      (op) string    (ALL)     (X)    (/field name)
        VALID          (FIRST)          (/field number)
        INVALID        (LAST)
        *              (PREV)


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*