EXCLUDE (EX, E, X)
The EXCLUDE command searches for and, if found, eliminates from the display any lines that meet specified conditions. When you enter the EXCLUDE command without parameters, File-AID displays the EXCLUDE 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.
rel (Operator)
Relational operator that specifies the relationship the edit data must have to the val1 parameter in order to qualify a line for exclusion. 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.
Example 1
Excludes a line containing an exact occurrence of the string ROMAN:
Example 2
Excludes a line containing a byte that is less than hex 05:
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:
excludes the next record where it finds any occurrence of the character string 'oak’, 'Oak’, or 'OAK’, for example, regardless of case.
excludes all records.
excludes all records containing the character string 'oak’ regardless of case.
To exclude a record containing a string that is also a keyword, you must enclose the string in single or double quotes:
excludes all records containing the character string 'ALL’, 'All’, or 'all’, for example, regardless of case.
excludes all records containing a single quote.
excludes all records containing 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 letter X.
Decimal string:
A delimited string of decimal digits (0-9) preceded by the letter F or H. The F or H can also be followed by the letter L and a number from 1 to 8 to specify the data length in bytes. A decimal string matches the data with the binary representation of the specified string for the specified length. For example:
Packed string
A delimited string of decimal digits (0-9) preceded by the letter 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.
File-AID matches only a packed data item of the specified length, starting in the specified column, and containing the packed decimal representation of the decimal string. If a data length is omitted, the data matches a valid packed decimal data item with a length of 1 to 16 (containing the specified value). For example:
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. For example:
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.
The following table shows an example for each data type string:
val1 Parameter Examples
Data type: | Example: |
---|---|
Simple | ABC |
Delimited | 'AB CD' |
Character | C'Smith' |
Hexadecimal | X'F1F2F3' |
Decimal | 999 |
Packed | P'59' |
Packed data | PL4 |
Text | T'AnyCASE' |
* (asterisk)
Value for the val1 parameter that specifies to reuse the last value specified in a CHANGE, EXCLUDE, or FIND command.
VALID, INVALID
Excludes 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.
A /field-name or /field-number parameter is required when VALID or INVALID is used. If neither is specified, File-AID interprets the VALID or INVALID keyword as a simple string.
A successful search displays the valid or invalid data found, followed by the word EXCLUDED. An unsuccessful search produces the message:
lrange (Start range, End range)
Confines the EXCLUDE command to a specified line range (records). For the line range limits, use any combination of user-defined labels, system labels, or valid line numbers, prefixed by a period.
If a single line label or line number is specified (or the same line is specified twice), File-AID limits the search to the specified line. Line range limits can 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.
Line ranges are not valid when browsing a keyed file.
Additional line labels can be defined by entering a string starting with a period followed by one of the letters A through Y.
Example 1
Excludes the first line containing the string ROMAN found within lines 2 to 5 (inclusive):
Example 2
Excludes the first line containing a byte having a value less than hex 05 found within the line range beginning at the user-defined label .MARK, and ending at the last line of the file.
X, NX (Lines to search)
X restricts the EXCLUDE command to excluded lines. NX restricts the EXCLUDE command to nonexcluded lines. If the lrange parameter is also specified, File-AID scans only excluded (or nonexcluded) lines within the specified line range.
NX confines the search to nonexcluded lines. If NX is not specified, File-AID may find the next occurrence of the specified data within excluded lines, so that no new lines may be excluded. Use NX with the ALL value to count all occurrences of the specified data found in newly excluded lines, rather than all occurrences of the specified data throughout the entire data set.
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.
EXCLUDE 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 |
Use the ALL parameter to exclude all lines that contain the specified data (within the lines defined by the lrange and X, NX parameters). The ALL parameter is mutually exclusive with the NEXT, PREV, FIRST, and LAST parameters. 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.
col1, col2 (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. Specify a single column or column range to override the default 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.
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.
If a record layout was not entered on the Edit screen, attempting to specify a /field-name or /field-number produces the message:
The /field-name or /field-number parameter must be prefixed by a slash (/) to distinguish it from val1 or column range parameter. A field name may 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:
A field name value that does not match any record field, produces the message:
Example
If the field AGE is a two-byte packed data field, the command:
is equivalent to:
The data cannot be defined in an inconsistent way. Thus, the command:
results in the error message:
even though X’100C’ is the internal representation of the value 100 in a two-byte packed data field.
Guidelines
File-AID performs a search without regard to case (upper/lower) for the CHANGE, EXCLUDE, and FIND 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.
The RFIND primary command repeats an EXCLUDE command. Using RFIND is equivalent to using EXCLUDE with the inherited parameters in all instances except when a previous search produced the message: TOP OF DATA REACHED or BOTTOM OF DATA REACHED. In this case, RFIND continues a forward or backward search at the opposite end of the data set. RFIND continues a search in the same direction beyond the previously specified line range.
When using RFIND, the lrange parameter is not inherited from the EXCLUDE command. Therefore, a repeated search using RFIND is not confined to the line range specified in an EXCLUDE command.
Once a CHANGE, EXCLUDE, or FIND command is executed, the REBUILD or CANCEL commands will not discard changes made to the edit data set or selected records.
After a successful search, File-AID positions the cursor below the excluded line. An unsuccessful search through the data set or defined line range produces the message: NO (rel)(val1) FOUND.
After a global exclude (ALL), the cursor positions below the first set of excluded lines (from the start of the file).
Character and Vertical Formatted Modes
Lines may also be excluded with the X (exclude) line command (Edit only).
The effect of the EXCLUDE command is cumulative, that is, lines that contain the specified data are added to the excluded subset and eliminated from the display. Previously excluded lines remain excluded.
EXCLUDE parameters may be presented in any order except that a col2 parameter must follow acol1 parameter. EXCLUDE is confined to the range of columns within the bounds, except when the col1, col1 and col2, /field-name, or /field-number parameter is specified.
Define the matching criteria (used to select lines to be excluded) either with the rel and val1 parameters or with the VALID or INVALID parameter. Use the remaining parameters to limit exclusions to specific lines and/or fields within lines, and specify which occurrence(s) of the specified data are to be excluded.
An EXCLUDE command divides the data set into two subsets that can be processed separately. The scope of the CHANGE, DELETE, EXCLUDE, and FIND primary commands can be confined to one or the other of these subsets by specifying the X or NX parameter.
Use the CHANGE, FIND, and RESET primary commands or the F (first), L (last), and S (show) line commands to redisplay lines previously excluded with the EXCLUDE primary command or the X (exclude) line command. Using CHANGE, FIND, or RESET moves the indicated lines from the excluded subset to the nonexcluded subset.
File-AID shows the number of excluded lines at a particular location in the data set with the message: N RECORD(S) NOT DISPLAYED, where N is the number of excluded lines at that location.
Formatted Mode
Excluded records are bypassed when scrolling through the data set.
An EXCLUDE command entered from the Formatted mode performs the same operation on the data set as it would if entered in Character or Vertical Formatted modes with the cursor placed on the currently displayed record.
After completing an exclude in Formatted mode, File-AID displays the first record following the first continuous group of excluded records. If the first continuous group of excluded records extends to the end of the data set, the last nonexcluded data record is displayed.
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.
EXCLUDE Command Screen
If you enter the EXCLUDE 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.
EXCLUDE Command Screen
COMMAND ===>
Specify EXCLUDE 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 EXCLUDE:
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 EXCLUDE command with operands:
EXCLUDE string (NEXT) (NX) (col-1 (col-2)) (range)
EX (op) string (ALL) (X) (/field name)
VALID (FIRST) (/field number)
INVALID (LAST)
* (PREV)