Excluding rows
When you are viewing or editing data, you can exclude
certain rows in
the data you are viewing. These rows are referred to as excluded rows
and are not displayed on your screen. The remaining rows (those that are
displayed on your screen) are referred to as non-excluded rows.
You may choose to exclude certain rows to restrict the scope of the CHANGE,
DELETE, and FIND primary commands. When you use one of these commands with data
that contains excluded rows and non-excluded rows, you can specify whether the
command is to affect:
- Only non-excluded rows,
- Only excluded rows, or
- All rows
To exclude certain rows in the table you are viewing, you can use:
- The EXCLUDE primary command. For example, the following command excludes all rows with the
string
SMITH
in column number 3:EXCLUDE ALL SMITH #3
The following command excludes the next row containing the stringXXX
within either column number 20 or column number 30:EXCLUDE XXX #20 #30
You can exclude a range of rows identified by afrom
label and ato
label. For example, the following command excludes a range of rows, starting with the row labeled.LABA
and ending with the row labeled.LABB
:EXCLUDE ALL .LABA .LABB
In a File Manager/Db2 editor session, you can specify an asterisk (*) as the search string to find the same string as you specified on the previous EXCLUDE primary command.
In a File Manager/Db2 editor session, you can limit the effect of the EXCLUDE command to specific portions of the data you are searching:- To limit the search for a string to only where it appears as a prefix in the data, specify the PREFIX parameter.
- To limit the search for a string to only where it appears as a suffix in the data, specify the SUFFIX parameter.
- To limit the search for a string to only where it appears as a word in the data, specify the WORD parameter.
- The following prefix commands:
- X
- Exclude one row.
- Xn
- Exclude n rows.
- XX
- Exclude a block of rows.
You can use the following line commands to show various rows from
a block of excluded rows:
- F
- Show the first row from a block of excluded rows.
- Fn
- Show the first n rows from a block of excluded rows.
- L
- Show the last row from a block of excluded rows.
- Ln
- Show the last n rows from a block of excluded rows.
Related tasks
Related references