S Search (Multiple Search Arguments))

S [-] [n] , arg [ op arg ] [...] ..... [, A] Multiple Search - Format 1

arg [col] [r] item

single search argument, as fully described in the preceding section "Search for Character Strings (Single Argument)".

op , | + | *

Logical operator for the preceding search argument arg.

, Search the current record for the preceding or the succeeding search argument. The search is considered to be fulfilled if either of the two search items are contained in the record.

+ Search the current record for the preceding and the succeeding search argument. The search is only considered to have been fulfilled if both of the search aruments are found in the record. The sequence of the arguments in the record is immaterial.

*[n] Search the current record for the preceding and the succeeding search argument. The search is considered to have been fulfilled when both search arguments are contained within the record. The search arguments must appear in the same sequence as specified in the search command.

   n Number of seperators, having any character content, that must exist between the first and the second search arguments. If n is not specified, then any number of seperating characters are allowed, including 0.

Any number of op arg statements can be chained.

Brackets can be used to separate the individual statements if they are linked with a '+' operator: (.. , .. , ...)+(.. , .. , ...).

A All: When a search is made containing multiple search arguments that have been "or"ed (",") together, it is not terminated after the first occurrence of the search item. On the one hand this leads to longer search times, but on the other hand it has the advantage of reporting all search hits in the commentary line of the CFS mask, together with their respective column positions.

Standard: The search is terminated after the first occurrence of the specified search item.

NC No Columns. The column positioning on the hit is suppressed in DL (Display Long) mode (same as in DS mode).

Notes:

The specified search arguments and operators are evaluated linearly. If multiple search arguments are chained with "+" or "*", and one of these search items is not contained in the record, then the search is terminated, or continued if it is linked with the "or" operator, "," .

For each individual search argument, arg, the following can be specified: column range (:col1-col2: / :col: / >:col: / <:col:), inverse selection ( -'item' ), character ( 'item' ) or hexadecimal ( X'item' ) format , or upper/lowercase ( L'item' ). When entering the search item in character format, the quotation marks can normally be omitted. For instance, entering the command S,FLAG*STATEMENT will search all records for the string 'FLAG', and anywhere thereafter the string 'STATEMENT'. For further information, see the syntax description and the Notes on page 8-.

In total, 71 bytes may be entered in the command line of CFS for multiple search criteria. This may be too restrictive if a large number of search arguments need to be entered. To avoid this, a search mask can be called from the CFS command line. This mask is called with the command S,() , as described below.

Examples:

S,'='*'(','DC '*'('*')'

All records are sought that meet one of the following criteria:

- The '=' sign and then somewhere thereafter a '(' character. e.g. '=A(...)', '=V(...)'

- The string 'DC ' and then somewhere thereafter the characters '(' and ')'.

e.g. 'DC A(...)', 'DC Y(...)'

S,:1:>X'004C'+:1:<X'0054'

To determine records of a particular length, the record length field can also be displayed with the Offset command O-4. Using the above search command for a file with RECFORM=V, all records longer than 76 bytes, and shorter than 84 bytes will be found.

S,-L'a'+-L'b'+-L'c'

All records will be found that do not contain the lowercase letters a, b, or c..

S,L'a',>L'a'+<L'z',L'z'

All records will be found that contain at least one lowercase letter.