EXCLUDE primary command
The EXCLUDE primary command excludes from display certain rows in the data being viewed, browsed, or edited.
You can only use the EXCLUDE primary command in TABL display format.
To redisplay excluded rows, enter the
command:
RESETSyntax
column list or range
label range
Notes:
- 1 You can specify parameters in any order.
- * (asterisk)
- Uses the search string specified on the previous EXCLUDE command as the search string.
- string
- The search string you want to search for. Rows containing this
string, within the limits imposed by the other EXCLUDE command parameters,
are excluded. The string can be:
- A character string not starting or ending with a single quotation mark and not containing any embedded blanks or commas. The case of the string is ignored. Uppercase and lowercase representations of the same character match. For example, “Mixed string” matches “MIXED string”.
- A character string enclosed in single quotation marks. The string can contain blanks and commas. The case of the string is ignored. For example, “Exact string” matches “exact string”.
- C followed by a character string enclosed in quotation marks (C'Frog'),
or a character string enclosed in quotation marks followed by
C('Frog'C). The string can contain blanks and commas. The string must match exactly (including case). For example, “Exact string” does not match “exact string”. - P preceded or followed by a picture string enclosed in single
or double quotation marks to describe a type of string to be found
rather than the exact characters. It can contain blanks, alphabetic
and numeric characters which represent themselves, or any of the special
characters listed here, each of which represents a class of characters:
- =
- Any character.
- @
- Alphabetic characters.
- #
- Numeric characters.
- $
- Special characters.
- & notsym;
- Non-blank characters.
- .
- Invalid characters.
- -
- Non-numeric characters.
- <
- Lowercase alphabetics.
- >
- Uppercase alphabetics.
Examples of picture strings used with the EXCLUDE command:
ex p'.' #4- Exclude invalid character in column 4.
ex p'###'- Exclude 3-digit number.
ex '@1'p #1- Exclude label a1,b1,c1, (and so on) in column 1.
ex p'<'- Exclude the next lowercase alphabetic character.
ex p'¬' #2- Exclude the next non-blank in column 2.
When this notation is used, numeric, bit and unicode fields (for SNGL and TABL display formats) are excluded from the search process.
- X followed by a hexadecimal string enclosed in single quotation marks For example, X'C1C2'.
- R preceded or followed by a regular expression string
enclosed in single or double quotation marks to specify a pattern for the string, rather
than the exact characters. The string must conform to the format allowed by the C runtime
library regcomp function supported by the C runtime library and the C
runtime library must be available. Use RC to perform a case sensitive search. Examples of regular expressions are as follows:
- 'cat' or 'hat' in columns 1 to 10
-
r'[ch]at' 1 10 - 'payer' or 'payee'
-
r'pay(er!ee)' - 'band' or 'bald' but not 'bad'
-
'ba.d'r - 'feed' or 'weed' but not 'fed' or 'wed'
-
r'[fw]e{2}d' - 'The' or 'She' but not 'the' or 'she'
-
rc'[TS]he'
The SETLOCALE function is used to define the locale used by the regcomp function to compile the regular expression. The locale used for the SETLOCALE function is based on the terminal CCSID. Locales are supported for the following terminal CCSIDs:00037 00871 01123 01156 00273 00875 01140 01157 00277 00924 01141 01158 00278 00930 01142 01160 00280 00933 01143 01165 00284 00935 01144 01364 00285 00937 01145 01371 00290 00939 01146 01388 00297 01025 01147 01390 00424 01026 01148 01399 00425 01027 01149 04971 00500 01047 01153 05123 00838 01112 01154 08482 00870 01122 01155 12712If you are using a terminal with a different CCSID, then the default C locale is used when compiling the regular expression. - A numeric value (only when you limit the search by specifying column numbers, and only when the column being searched is a numeric column).
- NEXT
- This is the default setting. Causes the search to begin at the cursor location (if the cursor is within the data portion of the display) or the beginning of the first row displayed, and searches ahead to find the next occurrence of string in a row that is not already excluded.
- ALL
- Causes the search to begin at the top of the data and find all
occurrences of string. If not specified,
the search begins at the cursor location (if the cursor is within
the data portion of the display) or the beginning of the first row
displayed, and searches ahead to find the next occurrence of string in
a row that is not already excluded.
The command EXCLUDE ALL excludes all displayed rows.
- FIRST
- Causes the search to begin at the beginning of the table and search ahead.
- LAST
- Causes the search to begin at the end of the table and search backwards.
- PREV
- Causes the search to begin at the cursor location (if the cursor is within the data portion of the display) or the beginning of the first row displayed, and searches backwards to find the string.
- CHARS
- Matches the search string anywhere in the data.
- PREFIX
- Matches the search string wherever it appears as a prefix in the data. To be a prefix, the matched text must be preceded by a non-alphanumeric character or be the start of a line or field, and must be followed by an alphanumeric character.
- SUFFIX
- Matches the search string wherever it appears as a suffix in the data. To be a suffix, the matched text must be preceded by an alphanumeric character, and must be followed by a non-alphanumeric character or be the end of a line or field.
- WORD
- Matches the search string wherever it appears as a word in the data. To be a word, the matched text must be preceded by a non-alphanumeric character or be the start of a line or field, and must be followed by a non-alphanumeric character or be the end of a line or field.
- #ALL
- Each column is searched according to its template attributes.
- col_num
- The Db2® column number (specified as #n) of a column to be included in the data search. Multiple column numbers must be separated by a comma or, if enclosed in brackets, separated by a blank or comma.
- col_num_1
- The first field reference of a range of fields. It cannot be subscripted. If the col_num_1 field reference value is less than the lowest displayed field reference value, the lowest displayed field reference value is used.
- col_num_2
- The last field reference of a range of fields. It cannot be subscripted.
If the col_num_2 field reference value is
greater than the highest displayed field reference value, the highest
displayed field reference value is used.
The col_num_1 and col_num_2 field reference values must be separated by a hyphen (-). Spaces are permitted between the hyphen and the field reference values.
If col_num_1 is a higher value than col_num_2, the search process reverses the operands.
- label1
- Label identifying the start of a range of rows. The label must start with a period (.) followed by one to four alphabetic characters (no numeric or special characters). Labels starting with the letter “Z” indicate an editor-assigned label.
- label2
- Label identifying the end of a range of rows. The label must start with a period (.) followed by one to four alphabetic characters (no numeric or special characters). Labels starting with the letter “Z” indicate an editor-assigned label.