Creating Selection Criteria
This tool is used to create selection criteria for use with Related Extract, specifically when setting selection criteria. Users specify options and conditions for selecting data records or rows for processing, thus creating a subset of data with which to work. These selection criteria are specified using a data definition as a template and can then be stored in a repository for later reuse.
To create Selection Criteria
- Do one of the following:
- In Data Explorer, navigate to the desired repository, right-click Selection Criteria, and select New.
- From the File menu, select New > Other. The Select a Wizard dialog box appears.
Select BMC > DevX
> Selection Criteria and click Next.
The New Selection Criteria dialog box appears.- In the Name field, enter a name for the selection criteria being created.
- Optionally, in the Description field, enter a description for the selection criteria being created.
- Optionally, from the Repository list, select a different repository in which to store the selection criteria.
- In the Table Name section, either enter a name in the field (in <schema.table> format) or click Browse. The Table selection dialog box appears to allow the user to locate the desired table.
- Select one of the following:
- Select the Database radio button to create selection criteria that can be used for a
extract specification.
- Select the Db2 for z/OS radio button to create selection criteria that can be used for a
extract specification.
- Select the Database radio button to create selection criteria that can be used for a
- To select the host, do either of the following:
- In the Host field, select the host connection from the list.
- Click Configure to add a new host connection. The Host Connections page of the Preferences dialog box appears. Complete this dialog box according to the instructions in the Host Explorer Connections topic in the Host Explorer User Guide.
- If the Db2 for z/OS radio button was selected, from the SSID list, select the DB2 subsystem that contains the desired schema and tables.
- In the Schemas box's Name field, enter a schema name and click List. A list of matching schemas appears. Refer to the Filters topic in the Host Explorer User Guide for information about filtering schema names.
From the resulting list, select the appropriate schema, and then use the Tables box to select or search for the desired table. The search is case-sensitive.
- Click Finish. The Selection Criteria - Overview tab appears with the above information populated.
- Click the Condition tab. The Selection Criteria - Condition page allows users to build conditions for selecting records. Conditions consist of a field name, condition type, and values. The first condition created is the top-level group condition. While individual conditions can be added to this group condition, there can only be one top-level group condition.
- Optionally, add an AND or OR condition to the selection criteria by doing one of the following:
- To add an AND condition, with All of these conditions must be true appearing in the Field Name field, click
.
- To add an OR condition, click All of these conditions must be true and then, from the drop-down list, select One or more of these conditions must be true. Then click
.
- To add an AND condition, with All of these conditions must be true appearing in the Field Name field, click
- Click <select field> and, from the drop-down list that appears, select a field from the list of fields available for the selected table (for example CompanyName).
- Press Tab. The <condition> field appears in the Condition Type column.
Click <condition> and, from the drop-down list, select an operator (for example is equal to). Operators, which vary by field type, include the following:
- is equal to
- is not equal to
- is greater than
- is less than
- is greater than or equal to
- is less than or equal to
- is null
- is not null
- is between
- is not between
- is in list
- is not in list
- is like
- is not like
- Selecting IS NULL does not allow for a valu
- When using the operator LIKE and looking for a string imbedded in another string, include the wildcard % in the condition statement before and after the operato For example: The condition statement would find JAPAN imbedded in another string.
- Press Tab. If, based on the operator selected, one or more values are needed to complete the condition, <enter values> appears. Otherwise, a SQL statement is generated (for example CompanyName = "BMC") and is added to the SQL box at the bottom of the wizard page.
If <enter values> appears, click <enter values>, then click
. A popup appropriate to the value type appears. Enter in the field(s) the appropriate value(s) to complete the condition (for example BMC), then click OK. A SQL statement is generated (for example CompanyName = "BMC") and is added to the SQL box at the bottom of the wizard page.
Repeat the process for any additional conditions by doing any of the following:
- Select the first condition you created and click
to begin adding another condition. A new condition line appears.
- Select the first condition you created and click
to begin adding a new group condition below the selected condition. A new condition line appears.
- Select a condition and click
to indent the condition, making it a subgroup of the item above it. A group condition can only be indented under another group condition. Only the last item in a group condition can be indented or outdented.
- Select a condition and click
to move the condition out from under another group condition. Only the last item in a group condition can be indented or outdented.
cannot be used to move a group condition to the root position.
- Select a condition and click
to move the condition up one row. If a group condition is selected, its child conditions will be moved with it. A group condition will be removed if its only condition is moved. Conditions cannot be moved above the top-level group condition.
- Select a condition and click
to move the condition down one row. If a group condition is selected, its child conditions will be moved with it. A group condition will be removed if its only condition is moved. Conditions cannot be moved above the top-level group condition.
- Select a condition and click
to delete the condition.
- Select the first condition you created and click
- When all conditions have been entered and positioned correctly, click
to validate the information entered and save it to the repository.
- For a
selection criteria only, select the Options tab. The Options Page appears. This page is used to specify the options for selecting records or rows from the entire source file or table: where to begin, how to continue, and when to stop.
- Under Starting record (row), select one of the following to indicate where to begin selection processing:
- Select First to begin processing with the first record in the table or file. This is the default.
- Select Record number and enter the record number to begin processing at a specific record in the table or file. This option is only applicable to non-keyed files or tables.
- Under From the specified starting record (row), select one of the following to indicate the intervals in which records should continue to be selected:
- Select Select every record (row) to select every record or row in the source file or table. This is the default.
- Select Select every <value> to select records at regular intervals, such as every 10th record. Enter the value in the field. Valid values are any number from 0 through 2,147,483,647. Selection criteria are applied after the record has been retrieved.
- Select Select every <value> then skip every <value> to select records at regular intervals but skip others (for example, entering 2 and 12 selects two records and then skips 12 records). Enter the values in the fields. Valid values are 0 through 2,147,483,647. Selection criteria are applied after the record has been retrieved.
- Select or clear the Limit number of records to search check box to indicate whether to stop searching records. When searching large files, limiting the search can help prevent excessive I/O processing. If the check box is selected, enter in the field a number indicating the maximum number of records that match the specified conditions for the wizard to search. For example, entering 1000 would result in a search of the first 1000 records that match the specified conditions, while entering 0 (zero) would result in all records that match the specified conditions being searched. Valid values 0 through 2,147,483,647.
- Select or clear the Limit number of records to select check box to indicate whether to stop selecting records. When searching large files, limiting the selection can help prevent excessive I/O processing. If the check box is selected, enter in the field a number indicating the maximum number of records that match the specified conditions for the wizard to select. For example, entering 1000 would result in the selection of the first 1000 records that match the specified conditions, while entering 0 (zero) would result in all records that match the specified conditions being selected. Valid values are 0 through 2,147,483,647.
- Click
to validate the information entered and save it to the repository. If information is missing, a popup dialog box appears showing any error messages.