2.25 FILTER

Use FILTER to filter the display based on one or more criteria.

  • You can string multiple FILTER commands together, separating each one with a semi-colon, as in:

    FILTER INCLUDE FILENAME fin.act*; FILTER RECTYPE 5; FILTER MATCH ALL
    

    Or...

    FILTER INCLUDE FILENAME $QA01.QAESRC.ACCTN; FILTER SYSKEY 4294967302; FILTER MATCH ALL
    
  • To avoid unexpected results, avoid stringing filter options together with one FILTER command. For example, the following would be incorrect:

    FILTER INCLUDE FILENAME fin.act*; RECTYPE 5; MATCH ALL
    

    Or...

    FILTER INCLUDE FILENAME $QA01.QAESRC.ACCTN; SYSKEY 4294967302
    

Without arguments, FILTER displays the current filter status (ON or OFF) and any filter criteria that are in effect.

Comparison Operators

For options that take comparison operators, the following standard operators may be used. The absence of an operator implies Equal.


Table 2-9 Filter Option Comparison Operators

Operator Example

Equal

=

EQ

==

Less than

<
LT

Less than or equal

<=
LE

Greater than

>
GT

Greater than or equal

>=
GE

Not equal

<>
NE
!=

Default

Shows current filter settings

Syntax

FILTER [INCLUDE] [EXCLUDE] filter_option

Where:

filter_option can be one of:

{
ANSINAME name [, name] |
AUDITRBA rba [comparison_operator] |
CLEAR {filter_spec | ALL} |
CSN | LogCSN [comparison_operator] [value]
ENDTIME time_string |
FILENAME name [, name] |
GGSTOKEN token_name [comparison_operator] [token_value] |
HEX "hex_string" [byte_range][, "hex_string" [byte_range]] [...] |
INT16 16_bit_integer |
INT32 32_bit_integer |
IOTYPE operation_type [, operation_type] |
MATCH {ANY | ALL} |
OFF |
ON |
PROCESS process_name |
RBA byte_address [comparison_operator] [...] |
RECLEN length [comparison_operator] |
RECTYPE {type_number | type_name} |
SHOW |
STARTTIME time_string |
STRING [BOTH] [B],text [       column_range   ]
    [[B],text [column_range]] [...] |
SYSKEY system_key [comparison_operator] [...] |
TRANSID transaction_identifier |
TRANSIND indicator [comparison_operator] |
TYPE type |
UNDOFLAG type [comparison_operator] |
USERTOKEN token_name [comparison_operator] [token_value]
}
ANSINAME name [, name]

Filters based on the ANSI name of a SQL/MX table or a table from a Windows or UNIX source system. For use on NonStop systems. The format for name is:

catalog.schema.table

Up to eight name specifications may be supplied. The command is case-sensitive.

To filter based on the name of a data file, use the FILENAME option.

AUDITRBA rba [comparison_operator]

Filters based on the relative byte address of a commit record. For comparison_operator, see "Comparison Operators".

CLEAR {filter_spec | ALL}

Removes filtering criteria.

  • ALL removes all filter criteria.

  • filter_spec removes only the specified criterion. Specify any FILTER option, but not the value. The following example is valid:

    FILTER CLEAR STRING
    

    The following example is not valid:

    FILTER CLEAR STRING "Denver"
    

An alias for CLEAR is RESET.

CSN | LogCSN [comparison_operator] [value]

Filters based on a commit sequence value.

For comparison_operator, see "Comparison Operators".

ENDTIME time_string

Ends the filter at the last record written at the specified time. For the time string, use the format of:

[[yy]yy-mm-dd] [hh[:mm][:ss]]

Example:

ENDTIME 2011-01-31 23:59:59

This command can be shortened to ENDTS or END.

FILENAME name [, name]

Filters based on the name of a SQL table, or a group of names, with the name format being:

[catalog.]owner.table
[catalog.]owner.string*

Also filters on the name of a NonStop data file, or a group of names, with the name format being:

volume.subvolume.file
volume.subvolume.string*

On Windows and UNIX, both types of objects are supported. On NonStop, only viewing NonStop files is supported. To view SQL tables on NonStop, use the ANSINAME option.

FILENAME is case-sensitive on Windows and UNIX systems. If the database requires quote marks around a name If opening a NonStop data file on Windows or UNIX, the file name is converted to upper case. FILENAME can be shortened to FILE or FI.

Up to eight name specifications may be supplied.

GGSTOKEN token_name [comparison_operator] [token_value]

Filters based on a specific token in the record header.

  • For token_name, provide the name of the token, such as TRANSID.

    To view a list of possible tokens and values, see "GGSTOKEN".

  • For token_value provide the actual value for this token that is to be the filter string.

For comparison_operator, see "Comparison Operators"

HEX "hex_string" [byte_range] [, "hex_string" [byte_range]] [...]

Filters based on a hex string and, optionally, a range of columns. To specify a range of columns, use the format of:

start_column:end_column 

Example:

10:35

This option allows up to eight hex string and column arguments. Hex strings must be enclosed within quotes.

Hex filter strings must be in double quotes.

INCLUDE

Specifies that the filter will include the information specified with other options in the current FILTER statement. Can be shortened to INC.

EXCLUDE

Specifies that the filter will exclude the information specified with other options in the current FILTER statement. Can be shortened to EXC.

INT16 16_bit_integer

Filters based on a 16-bit integer. Use with 16-bit processors.

INT32 32_bit_integer

Filters based on a 32-bit integer. Use with 32-bit processors.

IOTYPE operation_type [, operation_type]

Filters based on the type of operation. A list of record types can be viewed with the SHOW RECTYPE command in Logdump. Up to 32 operation types can be specified with IOTYPE.

MATCH {ANY | ALL}

Controls filtering response when multiple filters have been specified. Can be shortened to MAT or MA.

  • ANY includes a record for display or counts if the condition matches any of the filter conditions. This is the default.

  • ALL includes a record for display or counts only if the condition matches all of the filter conditions.

OFF

Disables record filtering. By default, filtering is disabled. An alias for this option is DISABLE.

ON

Enables record filtering. An alias for this option is ENABLE.

RBA byte_address [comparison_operator] [...]

Filters based on a relative byte address. Accepts either a 32-bit or 64-bit value. Up to 32 specifications can be supplied.

RECLEN length [comparison_operator]

Filters based on a record length, in bytes. For comparison_operator, see "Comparison Operators".

RECTYPE {type_number | type_name}

Filters based on the type of record. Can be either of the following:

  • The number assigned to the record type.

    FILTER RECTYPE 10
    
  • The name of the record type.

    FILTER RECTYPE Update
    

To view the record type names and numbers, issue the SHOW RECTYPE command. (See "SHOW".)

SHOW

Displays filter settings. Same as using FILTER without any options.

STARTTIME time_string

Starts the filter with the first record written at the specified time. For the time string, use the format of:

[[yy]yy-mm-dd] [hh[:mm][:ss]] 

Example:

STARTTIME 2011-01-01 00:00:00

Can be shortened to STARTTS or START.

STRING [BOTH] [B], "text" [column_range] [[B], text [column_range]] [...]
  • text filters based on a string. Enclose the string within double quotes.

  • column_range filters based on a range of columns. Use the format of:

    start_column:end_column

    Example:

    10:35
    
  • BOTH filters on both a string and a column range.

  • [B] specifies a case-insensitive match. You can match up to eight string and column arguments.

If the trail data is EBCDIC, issue the EBCDICDATA ON or ASCIIDATA OFF command before using FILTER STRING to ensure the correct matching.

STRING can be shortened to STR.

SYSKEY system_key [comparison_operator] [...]

Filters based on a NonStop source key. Accepts either a 32-bit or 64-bit value. Up to 32 specifications can be supplied.

TRANSIND indicator [comparison_operator]

Filters based on the TransInd field of the record header. Valid values:

0 = start of transaction

1 = middle of transaction

2 = end of transaction

3 = only record in transaction

For example, to filter for the end of a transaction, use the following command, including the spaces in the syntax:

FILTER INCLUDE TransInd > = 2

For comparison_operator, see "Comparison Operators"

TRANSID 'transaction_identifier'

Filters on the TMF transaction identifier when reading a TMF trail, for example:

FILTER INCLUDE TRANSID \GGQA(2).0.12792182.
UNDOFLAG type [comparison_operator]

Filters based on the NonStop undo flag. The undo flag is set for records that are undone when a TMF transaction is aborted. Normally, UndoFlag is set to zero, but if the record is the backout of a previously successful operation, then UndoFlag will be set to 1. An undo that is performed by the disc process because of a constraint violation is not marked as an undo.

For comparison_operator, see "Comparison Operators"

USERTOKEN token_name [comparison_operator] [token_value]

Filters based on a specific user token in the trail file header.

  • token_name is the name of any token that is defined with the TOKENS clause of a TABLE statement of the Extract parameter file. It is not case-sensitive.

  • token_value is either a constant that is enclosed within double quotes or the result of an column-conversion function, depending on what was specified in the TOKENS clause for token_name.

  • For comparison_operator, see "Comparison Operators"

The following shows filter options modified by comparison operators.

FILTER INCLUDE RECLEN > 400
FILTER INCLUDE RECLEN < 200
FILTER INCLUDE TRANSIND <> 1
FILTER INCLUDE SYSKEY > 202172700557313

The following filters for a data file name and for a relative key 19446, which has a hex value of 00004bf6. Because MATCH ALL is used, a record must meet all of the filter specifications to be included in the filter.

FILTER INCLUDE FILENAME $QA01.QAESRC.ACCT*
FILTER INCLUDE HEX "00004bf6" 0:3
FILTER MATCH ALL

The following filters for tables that start with ACC except for the ACCDET table, and for records that contain a timestamp between the specified start and stop times. By default, if a record matches any of the INCLUDE specifications, it is included in the filter.

FILTER INCLUDE FILENAME SALES.ACC*
FILTER EXCLUDE FILENAME SALES.ACCDET
FILTER INCLUDE STARTTIME 2011-01-11 17:00:00
FILTER INCLUDE ENDTIME 2011-01-11 19:00:00

The following shows filter options with multiple specifications. By default, a record that matches any of these specifications will be included in the filter. Note that in the STRING filter, two of the criteria are not case-sensitive, while one is, and the filter is confined to a column range.

FILTER INCLUDE IOTYPE insert,update,delete
FILTER INCLUDE STRING b"String1" "string2" b"String3" 25:50
FILTER INCLUDE FILENAME $QA01.QAESRC.ACCT1, $QA01.QAESRC.ACCT2, $QA01.QAESRC.ACCT3