Db2 for z/OS Connector > Mappings and mapping tasks with Db2 for z/OS Connector > Mapping configuration
  

Mapping configuration

You must configure a mapping that contains a Source transformation for a Db2 for z/OS source and map it to a Target transformation.
To begin creating a mapping in Data Integration, click New > Mappings > Mapping and then click Create. In the New Mapping dialog box, click Mapping > Continue.
When you define a Source transformation in a mapping, specify a name for the transformation, a Db2 for z/OS connection, the source type, and the table for the Db2 source object. You can also set some additional source properties. The PWX Bulk Metadata Adapter retrieves metadata for the source table from the Db2 database catalog.
A mapping must contain at least one Source transformation mapped to one Target transformation. Alternatively, a mapping can contain multiple Db2 for z/OS sources and multiple targets. For example, you can define multiple one-to-one mappings, map one source to multiple targets, or map multiple sources to one target. To map multiple sources to the one target, you can create multiple one-to-one mappings that map each source separately to the same target. In this case, each source must have a different primary key value.
When you define a Target transformation, specify a name for the transformation, a connection to the target and the target type. In the user's environment, the target can reside on premises or in a cloud. If you do not want to send all of the incoming fields to the target, you can define one or more exclusion field rules. As part of configuring the target, you must also map the incoming fields to the target fields. You can map fields automatically based on the field names or map them manually.
Instead of selecting specific connections and objects in the Source and Target transformations, you can define a parameter for the connection, the source or target object, or both. You then must enter a specific connection or object in the associated mapping tasks. If you want to use a parameter for the source or target connection, you must perform one of the following actions before the mapping can be successfully validated:
You can also completely or partially parameterize field mappings, and then define specific mappings in the mapping tasks.

Db2 for z/OS source properties in mappings

When you create a mapping, you configure a Source transformation for a Db2 for z/OS source and set some source properties for the Source transformation.
Click the Source transformation box on the mapping canvas. Then configure the source properties in the Source Properties panel below the mapping canvas.
If you have multiple Source transformations in a mapping, configure source properties for each source. If you use a specific connection instead of a connection parameter, enter the same connection for all sources.
Note: If a mapping includes source tables or columns that have special characters in their names, the associated mapping task fails because it cannot import the source metadata. Special characters include s #, $, @, %, *, !, and ~. Therefore, ensure that none of the source tables and mapped columns have names with any special character. Rename the tables and columns if necessary.
The Source Properties panel contains the following tabs on which you can enter information:
Note: Ignore the Partitions tab. Key-range partitioning is not supported.

Adding multiple source objects

When you create a Source transformation, you can select Db2 for z/OS multiple objects as the source type and then configure a join to combine the tables. You can define a relationship condition or a query to join the tables.
    1Click the Source transformation on the mapping canvas.
    2Click the Source tab, and then select Multiple Objects in the Object Type field.
    3From the Actions menu on the Objects and Relationships line, click Add Source Object.
    4Select a schema package and then select a source table in the schema that you want to join to another table or create an advanced relationship for.
    Let's select the EMPLOYEE table in the DSN81210 schema.
    5Click OK.
    6From the Related Objects Actions Menu in the row for the added table, select Add Related Objects.
    7In the Select Related Objects window, select a table from the list. Only tables that have a defined foreign key relationship with the table that was initially selected in Step 4 are listed.
    Let's select the DEPARTMENT table to join to the EMPLOYEE table
    8Click OK. The Source details show the join relationship.
    9If you have source tables for which you want to define an advanced relationship manually, for examples, tables that don't have a foreign key, select Advanced Relationship from the Related Objects Actions Menu in the row for the added object:
    10In the Advanced Relationship window, click Add Object to add more tables.
    11In the Select Source Object window, select one or more other source tables to include in the advanced relationship, and then click OK.
    12In the Advanced Relationship window, select the fields in each table required to define the relationship. Then in the Relationship box, manually enter conditions between the <table>.<field> entries, or you can enter a query to define the relationship among the tables.
    The tables and their fields are listed in the Fields box, and the relationship between the table.field entries use the = operator: DSN81210.EMPLOYEE.WORKDEPT = DEPARTMENT.DEPTNO
    Note: To join two tables, you can specify a simple condition. For example, employee.department=dept.id. To join more than two tables, you must specify the complete query. For example, <schema_name>.<table_name1> LEFT OUTER JOIN <schema_name>.<table_name2> ON <schema_name>.<table_name1>.<column_name1>=<schema_name>.<table_name2>.<column_name2>
    13Click OK.
    The following image shows an example of a simple advanced relationship condition between two Db2 tables:
    The joined EMPLOYEE and DEPARTMENT tables are listed under Source Object and the advanced relationship between them is shown under Relationship.

Rules and guidelines for adding multiple source objects

Consider the following rules and guidelines when you add multiple source objects:

Targets in mappings with Db2 for z/OS sources

To configure a target in a mapping, click the Target transformation box on the mapping canvas. Then configure the target properties in the Target Properties panel below the mapping canvas.
Note: To determine which target types are supported by the Db2 for z/OS Connector, see Supported targets.
In the Target Properties panel, enter information on the following tabs:

Lookup Transformation

You can configure a cached Lookup transformation when you use a Db2 for z/OS connection in a mapping to return data from a Db2 for z/OS source based on a specified lookup condition. However, the Db2 for z/OS Connector does not support uncached lookup.
For more information, see Cloud Data Integration Transformations.