Default language.

Writer instructions

Page title

For most spaces, this page must be titled Space announcements.

For spaces with localized content, this page must be titled Space announcements l10n.

Purpose

Provide an announcement banner on every page of your space.

Location

Move this page outside of your home branch.

Guidelines

Limited supportBMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Reorg for Db2 13.1.

IN predicate


In 

BMC AMI Utilities

, the IN predicate supports the standard Db2 subselect.

To process the subselect, BMC AMI Utilities complete this process:

  1. Extract the subselect statement.
  2. Pass the SQL to Db2 for processing.
  3. Collect the output.
  4. Filter the output from Db2 to exclude null and duplicate rows.
  5. Placed the output in an IBM MVS/ESA data space.
  6. Search the output by using a high-speed search engine.

The data type of the IN predicate operands must match exactly:

  • The left operand of the IN predicate data type must match the right operand, which is the result that Db2 returned.
  • The precision and scale of one operand must match the precision and scale of the other.

If the precision and scale are not the same, you can change them using the INTEGER, FLOAT, or DECIMAL Db2 built-in function. To improve performance when conversion is required, BMC recommends that you convert the right hand operand to the type and length of the left hand operand.

Example

Assume that the WHERE clause is specified as follows:

WHERE C1 IN (SELECT C2 FROM TB1)

The following table shows the possible data type combinations of C1 and C2, and the action required.

Data type C1

Data type C2

Action

SMALLINT

INTEGER

INTEGER(C1)

SMALLINT

DECIMAL(P,S)

DECIMAL(C1,P,S)

SMALLINT

REAL

(C1) IN (SELECT FLOAT(B) FROM TB1)

SMALLINT

FLOAT

FLOAT(C1)

INTEGER

SMALLINT

(SELECT INTEGER(C2) FROM TB1)

INTEGER

DECIMAL(P,S)

DECIMAL (C1,P,S)

INTEGER

REAL

FLOAT(C1) IN (SELECT FLOAT(B) FROM TB1)

INTEGER

FLOAT

FLOAT(C1)

REAL

SMALLINT

FLOAT(C1) IN (SELECT FLOAT(B) FROM TB1)

REAL

INTEGER

FLOAT(C1) IN (SELECT FLOAT(B) FROM TB1)

REAL

DECIMAL

DECIMAL(C1,P,S)

REAL

FLOAT

FLOAT(C1)

FLOAT

SMALLINT

(SELECT FLOAT(C2) FROM TB1)

FLOAT

INTEGER

(SELECT FLOAT(C2) FROM TB1)

FLOAT

DECIMAL

DECIMAL(C1,P,S)

FLOAT

REAL

(SELECT FLOAT(C2) FROM TB1)

DECIMAL(P,S)

SMALLINT

(SELECT DECIMAL(C2,P,S) FROM TB1)

DECIMAL(P,S)

INTEGER

(SELECT DECIMAL(C2,P,S) FROM TB1)

DECIMAL(P,S)

REAL

(SELECT DECIMAL(C2,P,S) FROM TB1)

DECIMAL(P,S)

FLOAT

(SELECT DECIMAL(C2,P,S) FROM TB1)

DECIMAL(P1,S1)

DECIMAL

DECIMAL(C1,P,S) IN (SELECT DECIMAL(C2,P,S) FROM TB1

where:

p= min(31,max*s1,s2)+maxp1-s1,p2-s2)) s=max(s1,s2)


External file technique


    • ==

To further accelerate the search process, or if the data does not reside in the Db2 table, use the external file technique. This technique utilizes non-Db2 syntax and requires an input file that has been generated by either BMC AMI Unload or the Db2 REORG UNLOAD product.

The full syntax of the feature is defined as follows:

WHERE columnName IN (FILE(ddname) FORMAT(format))

In this syntax:

  • columnName is the left operand of the IN predicate. This operand must be a column name and cannot be a constant. The attributes of this column dictate the data type, length, and null attribute of the first field of the external file.
  • ddname is the name of the DD statement in the current job step that references the external data file.
  • format is the internal format of the data in the external file. Specify FORMAT(UNLOAD). For more information about unload formats, see FORMAT (LOAD syntax).

Processing an IN predicate by using an external file causes BMC AMI Utilities to complete these actions:

  1. Read the specified DDNAME (which can be on DISK or TAPE).
  2. Filter out duplicate and null rows.
  3. Place the data in an MVS/ESA data space.
  4. Search the data via a high-speed search engine.

The IN predicate external file can contain several data fields or columns. However, only the first data field is extracted from the file; the remaining data fields are ignored. The first data field is recognized by using the same attributes of the left operand and can be the concatenation of columns.

Example

Assume that the following conditions exist:

  • File(DD1) contains the following records in hexadecimal format: C1C2C3C4C5
  • The data type for C1 is VARCHAR.

Executing the following expression returns incorrect output because the record in the file does not look like a VARCHAR:

WHERE C1 IN(FILE(DD1) FORMAT(ARCHIVE))

In one WHERE clause, you can have up to 200 IN predicates with different files, subselects, or both. You can use Boolean logic to form very complex pattern matching on large amounts of data at very high speeds. However, WHERE clause syntax errors might occur if memory space is exceeded. If that occurs, attempt to reduce the select data or add more paging data sets to your paging subsystem.

Important

If you are unloading to a file to be referenced by the BMC AMI Reorg WHERE … IN FILE(ddname), specify the same +DIGITS parameter on both the BMC AMI Unload job and the BMC AMI Reorg job.


  


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*