0% found this document useful (0 votes)
243 views28 pages

Working With Mappings

The document provides an overview of mappings in Informatica. It discusses what mappings are, how they are composed of sources, transformations, targets, and links, and how mapping objects are connected through ports. It then describes how to develop a mapping by adding objects, connecting them, and validating the mapping. The document also summarizes various tasks involved in working with mappings such as creating, opening, copying, exporting, importing, editing, saving, debugging, and deleting mappings.

Uploaded by

ypraju
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
243 views28 pages

Working With Mappings

The document provides an overview of mappings in Informatica. It discusses what mappings are, how they are composed of sources, transformations, targets, and links, and how mapping objects are connected through ports. It then describes how to develop a mapping by adding objects, connecting them, and validating the mapping. The document also summarizes various tasks involved in working with mappings such as creating, opening, copying, exporting, importing, editing, saving, debugging, and deleting mappings.

Uploaded by

ypraju
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 28

Mappings

By PenchalaRaju.Yanamala

This chapter includes the following topics:

Mappings Overview
Working with Mappings
Connecting Mapping Objects
Linking Ports
Propagating Port Attributes
Working with Sources in a Mapping
Working with Relational Sources in a Mapping
Working with Transformations in a Mapping
Working with Mapplets in a Mapping
Working with Targets in a Mapping
Creating Target Files by Transaction
Working with Relational Targets in a Mapping
Validating a Mapping
Using the Workflow Generation Wizard
Troubleshooting

Mappings Overview

A mapping is a set of source and target definitions linked by transformation


objects that define the rules for data transformation. Mappings represent the data
flow between sources and targets. When the Integration Service runs a session,
it uses the instructions configured in the mapping to read, transform, and write
data.

Every mapping must contain the following components:

Source definition. Describes the characteristics of a source table or file.


Transformation. Modifies data before writing it to targets. Use different
transformation objects to perform different functions.
Target definition. Defines the target table or file.
Links. Connect sources, targets, and transformations so the Integration Service
can move the data as it transforms it.

A mapping can also contain one or more mapplets. A mapplet is a set of


transformations that you build in the Mapplet Designer and can use in multiple
mappings.

When you add an object to a mapping, you configure the properties according to
the way you want the Integration Service to transform the data. You also connect
the mapping objects according to the way you want the Integration Service to
move the data. You connect the objects through ports.

The Mapping Designer displays objects in three different views:

Iconized. Shows an icon of the object with the object name.


Normal. Shows the columns in the ports tab and the input and output port
indicators. You can connect objects that are in the normal view.
Edit. Shows the object properties. You can switch between the different tabs
and configure the object in this view.

The mapping is dependent on these objects. When this metadata changes, the
Designer and other PowerCenter Client applications track the effects of these
changes on mappings. In these cases, you may find that mappings become
invalid even though you do not edit the mapping. When a mapping becomes
invalid, the Integration Service cannot run it properly, and the Workflow Manager
invalidates the session.

The only objects in a mapping that are not stored as independent repository
objects are the non-reusable transformations that you build within the mapping.
These non-reusable transformations are stored within the mapping only.

Developing a Mapping

Use the following steps as a guideline when you develop a mapping:

Verify that all source, target, and reusable objects are created. Create
source and target definitions. If you want to use mapplets, you must create
them also. You can create reusable transformations in the Transformation
1.Developer, or you can create them while you develop a mapping.
Create the mapping. Create a mapping by dragging a source, target, mapplet,
or reusable transformation into the Mapping Designer workspace, or you can
2.click Mappings > Create from the menu.
3.Add sources and targets. Add sources and targets to the mapping.
Add transformations and transformation logic. Add transformations to the
4.mapping and build transformation logic into the transformation properties.
5.Connect the mapping. Connect the mapping objects to create a flow of data
from sources to targets, through mapplets and transformations that add,
remove, or modify data along this flow.
Validate the mapping. Validate the mapping to identify connection or
6.transformation errors.
Save the mapping. When you save the mapping, the Designer validates it,
identifying any errors. The Designer displays validation messages in the Output
window. A mapping with errors is invalid, and you cannot run a session against
7.it until you validate it.

PowerCenter also provides a tool that you can use to create a template for a
PowerCenter mapping and generate multiple mappings from the template.
Mapping Architect for Visio provides an Informatica stencil for the Microsoft
Office Visio software that contains shapes representing PowerCenter mapping
objects. You can use the mapping object shapes to draw the mapping template
on the Visio drawing window.

Working with Mappings

You can complete the following tasks with mappings:

Create a mapping. When you create a mapping, you save the mapping name
in the repository. You can then develop and save the mapping.
Open a mapping. You can open one mapping at a time in a folder.
Copy a mapping. You can copy a mapping within the same folder or to another
folder.
Copy a mapping segment. You can copy segments of mappings and mapplets
when you want to reuse a portion of the mapping logic.
Copy objects in a mapping. You can copy one or more objects in a mapping
and paste them into another mapping or mapplet in the same folder.
Export a mapping. You can export a mapping to an XML file.
Import a mapping. You can import a mapping from an XML file that you
exported in the Designer.
Edit a mapping. You can add, modify, or delete objects in a mapping.
Save a mapping. When you save a mapping in the repository, the Designer
performs mapping validation.
Debug a mapping. Run the Debugger in the Mapping Designer to test mapping
logic.
Delete a mapping. Delete a mapping from the repository if you do not want to
use it again.
View link paths to a port. You can view link paths to a port in a mapping. You
can view the forward path, the backward path, or both.
View source column dependencies. You can view from which source columns
a target column receives data.
Connect objects in a mapping. You can connect objects in a mapping to
define the flow of data from sources to targets.
Link ports. You can connect mapping objects by linking ports manually or
automatically by name or position.
Propagate port attributes. You can propagate port attributes in a mapping.
You can propagate attributes forward, backward, or in both directions.

Creating a Mapping

The first step in the process of moving data between sources and targets is to
create a mapping in the Mapping Designer.
To create a mapping:

1.Open the Mapping Designer.


2.Click Mappings > Create, or drag a repository object into the workspace.
3.Enter a name for the new mapping and click OK.
The naming convention for mappings is m_MappingName, such as
m_ResearchProjects.

Opening a Mapping

To open a mapping, drag it from the Navigator into the Mapping Designer
workspace. If you have a mapping in the same folder already open, the Designer
prompts you to close it before continuing. Click OK to close the current mapping
and open the other one.

You can open one mapping at a time in a folder. If you open more than one
folder at a time, you can open a mapping in each folder.

Tip: To open a mapping, you can also right-click a mapping in the Navigator and
choose Open.

Copying a Mapping

You can copy mappings with the Designer:

Within a folder
To a folder in the same repository
To another repository

The Designer provides a Copy Wizard that lets you copy objects in the
repository. When you copy a mapping, the Copy Wizard creates a copy of each
component in the mapping, if the component does not already exist. If any of the
mapping components already exist, the Copy Wizard prompts you to rename,
replace, or reuse those components. However, if the object is a shortcut, or if the
destination folder already contains a shortcut with the same name, you cannot
replace the object. You can only rename or reuse the object. If a mapping
contains sources with primary key-foreign key relationships to sources not used
in the mapping, the Copy Wizard prompts you to copy the related source.

Copying Mapping Segments

You can copy segments of mappings and mapplets when you want to reuse a
portion of the mapping logic. A segment consists of one or more objects in a
mapping or mapplet. A segment can include a source, target, transformation,
mapplet, or shortcut. To copy mapping segments, select and copy the segments
from the mapping designer and paste them into a target mapping or an empty
mapping or mapplet workspace. You can copy segments across folders or
repositories.

To copy a segment of a mapping or mapplet:

1.Open a mapping or mapplet.


2.Select a segment by highlighting each object you want to copy.
You can select multiple objects. You can also select segments by dragging the
pointer in a rectangle around objects in the workspace.
3.Click Edit > Copy or press Ctrl+C to copy the segment to the clipboard.
Open a target mapping or mapplet. You can also paste the segment into an
4.empty workspace.
5.Click Edit > Paste or press Ctrl+V.

The Designer prompts you to rename, reuse, or replace objects with conflicts.

Using the Copy As Command

If you make changes to a mapping, but you do not want to overwrite the original
mapping, you can make a copy of the changed mapping by clicking Mappings >
Copy As. When you use Copy As, the copy of the mapping contains the changes
and the original mapping does not reflect these changes.

You can only use Copy As within the same folder. When you use Copy As, the
mapping must be open in the workspace.

To use the Copy As command to copy a mapping:

1.Open a mapping in the Mapping Designer workspace.


2.Click Mappings > Copy As.
3.Enter the new mapping name.
4.Click OK.
You cannot use Copy As to copy shortcuts.

Copying Mapping Objects

The Designer lets you copy one or more objects in a mapping. You can paste the
objects you copy into any other mapping or mapplet in the same folder. You
might want to copy objects from a mapping and paste them into another mapping
or mapplet to reuse transformation logic you created.

Exporting and Importing a Mapping

You export a mapping to an XML file and import a mapping from an XML file
through the Designer. You might want to use the export and import feature to
copy a mapping to the same repository, a connected repository, or a repository to
which you cannot connect. For more information about exporting and importing
mappings and other objects, see the PowerCenter Repository Guide.

Editing a Mapping

After you create a mapping, you can edit it by adding, modifying, or deleting
objects. Objects include source definitions, target definitions, mapplets, and
transformations. Before the Designer deletes objects in the mapping, it displays
the list of objects to delete. The Designer displays a validation message in the
Output window when you save a mapping.

To see what sessions or shortcuts may be affected by changes you make to a


mapping, select the mapping in the Navigator, right-click, and select View
Dependencies. Or, click Mappings > View Dependencies.
Reverting to a Previously Saved Mapping

While editing a mapping, you can revert to a previously-saved mapping, undoing


changes you have entered since the last save. To do this, click Edit > Revert to
Saved. When you click Yes, the Designer removes all changes entered since the
last time you saved the mapping.

Renaming and Adding Comments to a Mapping

You can rename, add comments, or specify links to business documentation for
a mapping at any time. Adding comments or business documentation links is an
easy way to document the purpose of a mapping. The Repository Manager and
MX views include these comments to help you analyze the metadata.

To rename or add comments to a mapping:

1.Open a mapping in the Mapping Designer and click Mappings > Edit.
2.In the Edit Mapping dialog box, enter a new name for the mapping.
3.Add a description of the mapping in the comments box.
You can enter up to 2,000 characters.
4.Click OK.

Invalidating Sessions

When you edit and save a mapping, some changes cause the session to be
invalid even though the mapping remains valid. The Integration Service does not
run invalid sessions. If you edit a mapping, the Designer invalidates sessions
when you perform the following actions:

Add or remove sources or targets.


Remove mapplets or transformations.
Replace a source, target, mapplet, or transformation when importing or copying
objects.
Add or remove Source Qualifiers or COBOL Normalizers, or change the list of
associated sources for these transformations.
Add or remove a Joiner or Update Strategy transformation.
Add or remove transformations from a mapplet in the mapping.
Change the database type for a source or target.

Debugging a Mapping

You can debug a valid mapping to gain troubleshooting information about data
and error conditions. To debug a mapping, you configure and run the Debugger
from within the Mapping Designer. When you run the Debugger, it pauses at
breakpoints and you can view and edit transformation output data.

Deleting a Mapping

You may delete mappings that you no longer use. When you delete a mapping,
you do not delete any sources, targets, mapplets, or reusable transformations
defined outside the mapping.
Note: If you enable version control, a deleted mapping remains checked out until
you check it in. To check in a deleted mapping, click Versioning > Find
Checkouts. Select the deleted mapping and click Tools > Check In.

You can delete a mapping from the Navigator window, or you can delete the
mapping currently displayed in the Mapping Designer workspace.

To delete a mapping from the Navigator window, select the mapping and press
the Delete key, or click
Edit > Delete.
To delete a mapping currently displayed in the Mapping Designer workspace,
click Mappings > Delete.

Viewing Link Paths to a Port

When editing a mapping, you may want to view the forward and backward link
paths to a particular port. Link paths allow you to see the flow of data from a
column in a source, through ports in transformations, to a port in the target.

To view link paths, highlight a port and right-click it. Select the Select Link Path
option. You can choose to view either the forward path, backward path, or both.
The Designer displays all the connectors in the link path you select.

When displaying both link paths, the Designer traces the flow of data from one
column in the source, in and out of each transformation, and into a single port in
the target. For unconnected transformations, the Designer does not display a link
path. For connected Lookup transformations, the Designer shows each output
port dependent upon the input ports involved in the lookup condition. For Custom
transformations, the Designer shows that an output port depends on all input
ports by default. However, if you define port relationships in a Custom
transformation, the Designer shows the dependent ports you define.

Note: You can configure the color the Designer uses to display connectors in a
link path. When configuring the format options, choose the Link Selection option.

Viewing Source Column Dependencies

When editing a mapping, you can view source column dependencies for a target
column. Viewing source column dependencies lets you see from which source
columns a target column receives data.

To view column dependencies, right-click a target column in a mapping and


choose Show Field Dependencies. The Designer displays the Field
Dependencies dialog box which lists all source columns connected to the target
column.

When you define a port expression that performs a calculation using multiple
source columns, and then connect that port to a target column, the Field
Dependencies dialog box lists all source columns you use in the expression.
Connecting Mapping Objects

After you add and configure source, target, and transformation objects in a
mapping, complete the mapping by connecting the mapping objects. You
connect mapping objects through the ports. Data passes into and out of a
transformation through the following ports:

Input ports. Receive data.


Output ports. Pass data.
Input/output ports. Receive data and pass it unchanged.

Every source instance, target instance, mapplet, and transformation contains a


collection of ports, each representing a column of data:

Sources provide data, so they contain only output ports.


Targets receive data, so they contain only input ports.
Mapplets contain only input and output ports.
Transformations contain a mix of input, output, and input/output ports,
depending on the transformation and its application.

To connect ports, you drag between ports in different mapping objects. The
Designer validates the connection and creates the connection only when the
connection meets link validation and concatenation requirements.

Options for Linking Ports

When you link transformations, you can link with one of the following options:

One to one. Link one transformation or output group to one transformation,


input group, or target only.
One to many.
-
Link one port to multiple transformations, input groups, or targets.
-Link multiple ports in one transformation or output group to multiple
transformations, input groups, or targets.
Many to one. Link many transformations to one transformation, input group, or
target.

Linking One to Many

When you want to use the same data for different purposes, you can link the port
providing that data to several ports in the mapping. For example, salary
information might be used to calculate the average salary in a department
through the Aggregator transformation, while the same information might appear
in an Expression transformation configured to calculate each employee’s monthly
pay.

Rules and Guidelines for Connecting Mapping Objects

If the Designer detects an error when you try to link ports between two mapping
objects, it displays a symbol indicating that you cannot link the ports.

Use the following rules and guidelines when you connect mapping objects:

Follow logic of data flow in the mapping. You


can link the following types of ports:
- The receiving port must be an input or input/output port.
-The originating port must be an output or input/output port.
-
You cannot link input ports to input ports or output ports to output ports.
You must link at least one port of an input group to an upstream transformation.
You must link at least one port of an output group to a downstream
transformation.
You can link ports from one active transformation or one output group of an
active transformation to an input group of another transformation.
You cannot connect an active transformation and a passive transformation to
the same downstream transformation or transformation input group.
You cannot connect more than one active transformation to the same
downstream transformation or transformation input group.
You can connect any number of passive transformations to the same
downstream transformation, transformation input group, or target.
You can link ports from two output groups in the same transformation to one
Joiner transformation configured for sorted data as long as the data from both
output groups is sorted.
You can only link ports with compatible datatypes. The Designer verifies that it
can map between the two datatypes before linking them. The Integration
Service cannot transform data between ports with incompatible datatypes. While
the datatypes do not have to be identical, they do have to be compatible, such
as Char and Varchar.
You must connect a source definition to a source qualifier only. You then link the
source qualifier to targets or other transformations.
You can link columns to a target definition in a mapping, but you cannot copy
columns into a target definition in a mapping. Use the Target Designer to add
columns to a target definition.

Note: Even if you follow the rules and guidelines listed here, the Designer marks
some mappings invalid if the mapping violates data flow validation.

Linking Ports

You can manually link ports, or you can automatically link ports between
transformations. When you link ports automatically, you can link by position or by
name. When you link ports automatically by name, you can specify a prefix or
suffix by which to link the ports. Use prefixes or suffixes to indicate where ports
occur in a mapping. For example, a mapping includes a port in the Source
Qualifier called Name and a corresponding port in a Filter transformation called
FilName. ‘Fil’ is the prefix you specify when you automatically link ports between
the Source Qualifier and Filter transformation.

Manually Linking Ports

To link ports manually, click Layout > Link Columns. When you drag from one
port to another, the Designer creates a connection. When you drag into an empty
port, the Designer copies the port and creates a connection.

You can also link multiple ports at the same time. Use the Ctrl or Shift key to
select a range of ports to link to another transformation. The Designer links the
ports, beginning with the top pair. It links all ports that meet the validation
requirements.

Linking Ports by Position


When you link by position, the Designer links the first output port to the first input
port, the second output port to the second input port, and so forth. Use this option
when you create transformations with related ports in the same order. Use the
following options to link by position:

Autolink dialog box. To automatically link ports using the Autolink dialog box,
click Layout > Autolink.
Autolink command. To link ports by selecting the ports in the workspace, click
Layout > Autolink by Position.

To link ports by position using the Autolink dialog box:

1.Click Layout > Autolink.


2.Select the transformations and targets.
You can select multiple transformations in the To Transformations list to link one
transformation to multiple transformations. For objects that contain multiple input
groups such as Custom transformations or XML targets, select the group name
from the To Transformation list.
You can also select the transformations in the workspace in the order you want
to link them. Then, in the Autolink dialog box, select each From Transformation
and the Designer selects the To Transformation based on the order in which you
selected it in the workspace. Click Apply and then select the next From
Transformation and click Apply.
3.Select Position.
4.Click OK.
The Designer links the first output port to the first input port, the second output
port to the second input port, and so forth.

To link ports by position using the Autolink by Position command:

1.Click Layout > Autolink by Position.


Select the mapping object that you want to link by position and drag the
2.selected ports to another mapping object.
The Designer selects all of the ports in an object. To select only specific ports,
use the Autolink dialog box.
The Designer links the first output port to the first input port, the second output
3.port to the second input port, and so forth.
4.When you finish linking ports, click Layout > Link Columns.

Linking Ports by Name

You can link ports by name in the Designer. The Designer adds links between
input and output ports that have the same name. Linking by name is not case-
sensitive. Link by name when you use the same port names across
transformations. The Designer can link ports based on prefixes and suffixes you
define. Link by name and prefix or suffix when you use prefixes or suffixes in port
names to distinguish where they occur in the mapping or mapplet. Use the
following options to link by name:

Autolink dialog box. To automatically link ports by name, link ports by name
and prefix, and link ports by name and suffix using the Autolink dialog box, click
Layout > Autolink.
Autolink command. To link objects by selecting the ports in the workspace,
click Layout > Autolink by Name.
To link ports by name using the Autolink dialog box:

1.Click Layout > Autolink.


2.Select the transformations and targets.
You can select multiple transformations in the To Transformations list to link one
transformation to multiple transformations. For objects that contain multiple input
groups such as Custom transformations or XML targets, select the group name
from the To Transformation list.
3.Select Name.
4.Click OK.

To link ports by name and prefix or suffix using the Autolink dialog box:

1.Click Layout > Autolink.


2.Select the transformations and targets.
You can select multiple transformations in the To Transformations list to link one
transformation to multiple transformations. For objects that contain input groups
such as Custom transformations or XML targets, select the group name from the
To Transformation list.
3.Select Name.
4.Click More to view the options for entering prefixes and suffixes.
In From Transformation, enter the prefix or suffix used in the ports from which
5.you are linking.
In To Transformation, enter the prefix or suffix used in the ports to which you
6.are linking.
In this example, the Designer links ports in SQ_CUSTOMERS to ports in
FIL_STATE where the port name in FIL_STATE is either the same as
SQ_CUSTOMERS, or is the same and is preceded by the prefix “F_”.
7.Click OK.

To link ports by name using the Autolink by Name command:

1.Click Layout > Autolink by Name.


Select the mapping object that you want to link by name and drag the selected
2.ports to another mapping object.
The Designer selects all of the ports in an object. To select only specific ports,
use the Autolink dialog box.
The Designer adds links between input and output ports that have the same
3.name, regardless of name case.
4.When you are finished linking ports, click Layout > Link Columns.

Propagating Port Attributes

When you edit a port name in a transformation, by default, the Designer


propagates references to that port in the expressions, conditions, and other ports
in that transformation. You can also propagate changed attributes throughout the
mapping.

The Designer propagates ports, expressions, and conditions based on the


following factors:

The direction that you propagate. You can propagate changes forward,
backward, or in both directions.
The attributes you choose to propagate. You can propagate port name,
datatype, precision, scale, and description.
The type of dependencies. You can propagate changes to dependencies
along a link path or to implicit dependencies within a transformation.

Understanding Dependency Types

When you propagate port attributes, the Designer can update the following
dependencies:

Link path dependencies. A link path dependency is a dependency between a


propagated port and the ports in its link path. When you propagate link path
dependencies, the Designer also performs default updates to references in
expressions and conditions that depend on ports in the link path.
Implicit dependencies. An implicit dependency is a dependency within a
transformation between two ports based on an expression or condition.
For example, when you change the datatype of a port that is used in a lookup
condition, the Designer propagates the datatype change to the other port
dependent on the condition.

Propagating Dependencies in a Link Path

When you propagate dependencies in a link path, the Designer updates all the
input and input/output ports in its forward link path and all the output and
input/output ports in its backward link path. The Designer performs the following
updates:

Updates the port name, datatype, precision, scale, and description for all ports
in the link path of the propagated port.
Updates all expressions or conditions that reference the propagated port with
the changed port name.
Updates the associated port property in a dynamic Lookup transformation if the
associated port name changes.
Updates the port name of Custom transformation port dependencies.

Note: When you propagate a port name, the Designer appends “1” to the port
name if a port with the same name exists in the transformation.
Propagating Implicit Dependencies

You can propagate datatype, precision, scale, and description to ports with
implicit dependencies. When you click Options in the Propagate Ports dialog box,
you can choose to parse conditions and expressions to identify the implicit
dependencies of the propagated port. All ports with implicit dependencies are
output or input/output ports.

When you include conditions the Designer updates the following dependencies:

Link path dependencies.


Output ports used in the same lookup condition as the propagated port.
Associated ports in dynamic Lookup transformations that are associated with
the propagated port.
Output ports used by a Custom transformation to define a port relationship with
one or more input or input/output ports.
Master ports used in the same join condition as the detail port.

When you include expressions, the Designer updates the following


dependencies:

Link path dependencies.


Output ports containing an expression that uses the propagated port.
Propagated Attributes by Transformation

Table 5-1 describes the dependencies and attributes the Designer propagates for
each transformation:

Table 5-1. Propagated Attributes by Transformation


Transformation Dependency Propagated Attribute
Aggregator - -Port name, datatype,
Ports in link path precision, scale, description
- -
Expression Port name
- -
Implicit dependencies Datatype, precision, scale
Application - -Port name, datatype, precision,
Source Qualifier Ports in link path scale, description
Custom - -Port name, datatype,
Ports in link path precision, scale, description
- -
Port dependency Port name
- -
Implicit dependencies Datatype, precision, scale
Expression - -Port name, datatype,
Ports in link path precision, scale, description
- -
Expression Port name
- -Datatype, precision, scale,
Implicit dependencies description
External - -Port name, datatype, precision,
Procedure Ports in link path scale, description
Filter - -Port name, datatype,
Ports in link path precision, scale, description
- -
Condition Port name
Input - -Port name, datatype, precision,
Ports in link path scale, description
Joiner - -Port name, datatype,
Ports in link path precision, scale, description
- -
Condition Port name
- -Datatype, precision, scale,
Implicit dependencies description
Lookup - -Port name, datatype,
Ports in link path precision, scale, description
- -
Condition Port name
-Associated ports (dynamic -
Lookup) Port name
- -Datatype, precision, scale,
Implicit dependencies description
Normalizer in the - -Port name, datatype, precision,
Pipeline Ports in link path scale, description
Normalizer - -
Source Qualifier n/a none
Output - -Port name, datatype, precision,
Ports in link path scale, description
Rank - -Port name, datatype,
Ports in link path precision, scale, description
- -
Expression Port name
- -Datatype, precision, scale,
Implicit dependencies description
Router - -Port name, datatype,
Ports in link path precision, scale, description
- -
Condition Port name
SDK Source - -
Qualifier n/a none
Sequence - -
Generator n/a none
Sorter - -Port name, datatype, precision,
Ports in link path scale, description
Source Qualifier - -Port name, datatype, precision,
Ports in link path scale, description
SQL - -Port name, datatype, precision,
Ports in link path scale, description
Stored - -Port name, datatype, precision,
Procedure Ports in link path scale, description
Transaction -Ports in link path -Port name, datatype,
Control precision, scale, description
- -
Condition Port name
Union - -Port name, datatype,
Ports in link path precision, scale, description
- -Datatype, precision, and scale,
Implicit dependencies description
Update Strategy - -Port name, datatype,
Ports in link path precision, scale, description
- -
Expression Port name
- -Datatype, precision, scale,
Implicit dependencies description
XML Generator - -Port name, datatype, precision,
Ports in link path scale, description
XML Parser - -Port name, datatype, precision,
Ports in link path scale, description
XML Source - -
Qualifier n/a none

The Designer does not propagate changes to the following mapping objects:

Unconnected transformations
Reusable transformations
Mapplets
Source and target instances
SDK Source Qualifier

Rules and Guidelines

Use the following rules and guidelines when you propagate port attributes:

The Designer does not propagate to implicit dependencies within the same
transformation.
When you propagate a port description, the Designer overwrites the description
for the port in the other transformations in the mapping.
When you propagate backward along the link path, verify that the change does
not cause the Integration Service to fail the session. For example, if you
propagate changes to a source qualifier, the Integration Service might generate
invalid SQL when it runs the session. If you change the port name “CUST_ID” to
“CUSTOMER_ID,” the Integration Service might generate SQL to select the
wrong column name if the source table uses “CUST_ID.”
When you propagate port attributes, verify that the change does not cause the
Designer to invalidate the mapping. For example, when you change the
datatype of a port from integer to string and propagate the datatype to other
transformations, the Designer invalidates the mapping if a calculation uses one
of the changed ports. Validate the mapping after you propagate ports. If the
Designer invalidates the mapping, click Edit > Revert to Saved to revert to the
last saved version of the mapping.
When you propagate multiple ports, and an expression or condition depends on
more than one propagated port, the Designer does not propagate attributes to
implicit dependencies if the attributes do not match.
For example, you have the following expression in an Expression transformation:
Item_desc_out = Substr(ITEM_NAME, 0, 6) || Substr(ITEM_DESC, 0, 6)

The precision of Item_desc_out is 12, ITEM_NAME is 10, and ITEM_DESC is


10. You change the precision of ITEM_DESC to 15. You select parse
expressions to infer dependencies and propagate the port attributes of
ITEM_NAME and ITEM_DESC. The Designer does not update the precision of
the Item_desc_out port in the Expression transformation since the ITEM_NAME
and ITEM_DESC ports have different precisions.

Steps to Propagate Port Attributes

Complete the following steps to propagate port attributes:

To propagate port attributes:

Open a mapping in the Mapping Designer, and select one or more ports to
1.propagate.
Click Mappings > Propagate Attributes, and choose Propagate Attributes. Or,
2.right-click the port and choose Propagate Attributes.
The Designer displays the Propagate Port Attributes dialog box.
After you open the Propagate Port Attributes dialog box, you can select another
port and propagate its attributes.
3.Select the direction and attributes you want to propagate.
4.Optionally, to infer dependencies, click Options.
Table 5-2 describes the options on the Propagate Port Attributes dialog box:
Table 5-2. Propagate Port Attributes Dialog Box
Option Description
Preview Displays the links to the affected ports in green and the unaffected
ports in red.
Propagate Propagates the port attributes according to the options you specify in
the dialog box.
Direction Instructs the Designer to propagate attributes forward, backward, or
in both directions.
Attributes to Specifies the attributes that you want to propagate. The attributes
Propagate include name, datatype, precision, scale, and description.
Options Select to read conditions or expressions and propagate attributes to
implicit dependencies. The Designer disables these options when
you propagate the port name. These options are clear by default.
When you select one of these options and click Preview, the
Designer highlights the link paths to the dependent ports.
5.Click Preview to view the affected ports.
The Designer displays the links to the affected ports in green and the unaffected
ports in red.
6.Click Propagate.
When you propagate port attributes, the Output window displays the propagated
attributes and the affected ports.
7.Click Close.

Working with Sources in a Mapping


When you create a mapping, you must add one or more source definitions to it.
When you drag a source into the Mapping Designer workspace, you add an
instance of the source definition to the mapping.

For relational sources, you can edit the source definition and override the default
source table name.

Every mapping requires at least one of the following source qualifiers that
determines how the Integration Service reads the source data:

Source Qualifier transformation. Represents data read from relational and flat
file sources.
Normalizer transformation. Represents data read from COBOL sources.
Application Source Qualifier transformation. Represents data read from
Application sources.
XML Source Qualifier transformation. Represents data read from XML
sources.

You can let the Designer create the source qualifier by default. Each time you
drag a source instance into a mapping, the Designer adds a source qualifier and
connects it to the source. Use the automatic source qualifier creation when you
want to create one source qualifier for each source in the mapping. You can
disable the automatic creation when you want to join data from different relational
sources. You can then manually create and connect it to the source.

When you edit the source in the Source Analyzer, all instances of the source in
mappings inherit the changes. Some changes might invalidate the mappings
using the source.

However, you specify some properties for every source instance in a mapping.
Double-click the source instance in the Mapping Designer and click the
Properties tab. For relational sources, you can specify the table owner name. For
flat file sources, you can specify the default datetime format, thousands
separator, and decimal separator.

Note: When you add a source definition with some special characters in the table
name to a mapping, the Designer replaces the character with an underscore in
the source instance name for the mapping.

For more information about disabling the automatic source qualifier creation, see
Configuring Format Options.

Working with Relational Sources in a Mapping

When you add a relational source to a mapping, you can view the table owner
name and override the source table name. You can view this information on the
Properties tab of a relational source instance in the Mapping Designer.

The table owner name displays the owner name of the source table in the
database. For some databases, such as DB2, tables can have different owners.
You can override the table owner name for each source instance in the session
properties.
You can override the source table name for relational source instances on the
Properties tab of the source instance. Override the source table name when you
use a single mapping to read data from different source tables. Enter a table
name in the source table name. You can also enter a parameter or variable. You
can use mapping parameters, mapping variables, session parameters, workflow
variables, or worklet variables in the source table name. For example, you can
use a session parameter, $ParamSrcTable, as the source table name, and set
$ParamSrcTable to the source table name in the parameter file.

Note: If you override the source table name on the Properties tab of the source
instance, and you override the source table name using an SQL query, the
Integration Service uses the source table name defined in the SQL query.

To override a source table name:

1.In the Designer, open the Mapping Designer tool.


2.Double-click the title bar of a relational source instance in the mapping.
On the Properties tab, enter the source table name. You can also enter a
3.parameter or variable in the Source Table Name field.
If you use a user-defined mapping parameter, mapping variable, workflow
variable, or worklet variable, you must declare the parameter or variable.
4.Click OK.
If you use a parameter or variable for the source table name, define the
5.parameter or variable in the appropriate section of the parameter file.

Working with Transformations in a Mapping

A transformation is a repository object that generates, modifies, or passes data.


You configure logic in a transformation that the Integration Service uses to
transform data. The Designer provides a set of transformations that perform
specific functions. For example, an Aggregator transformation performs
calculations on groups of data.

You can create transformations to use once in a mapping, or you can create
reusable transformations to use in multiple mappings. When you add a reusable
transformation to a mapping, you add an instance of the transformation. When
you edit the reusable transformation in the Transformation Developer, all
instances of the transformation in mappings inherit the changes. Some changes
might invalidate the mappings using the reusable transformation.

Working with Mapplets in a Mapping

You can build mapplets in the Mapplet Designer when you want to use a
standardized set of transformation logic in several mappings. When you use a
mapplet in a mapping, the Designer creates an instance of the mapplet. The
mapplet instance displays only the ports from the Input and Output
transformations. These transformations display as groups. You can enter
comments for the instance of the mapplet in the mapping, but you cannot edit
other mapplet properties.

You can expand the mapplet in the Mapping Designer by selecting it and clicking
Mappings > Expand from the menu. This expands the mapplet within the
mapping for view. You can open or iconize all the transformations in the mapplet
and mapping, but you cannot edit any of the properties.
When you edit the mapplet in the Mapplet Designer, all instances of the mapplet
in mappings inherit the changes. Some changes might invalidate the mappings
using the mapplet.

Working with Targets in a Mapping

When you create a mapping, you must add one or more target definitions to it.
When you drag a target definition into the Mapping Designer workspace, you add
an instance of the target definition.

When you add targets to a mapping, you can include different types of targets.
You can include targets of the same database type, but different database
connections. You can also include both relational and flat file targets in the same
mapping.

When you edit the target in the Target Designer, all instances of the target in
mappings inherit the changes. Some changes might invalidate the mappings
using the target.

Note: When you add a target definition with some special characters in the table
name to a mapping, the Designer replaces the character with an underscore in
the target instance name for the mapping.

You can configure properties for relational, file, and XML targets in a mapping.

Configuring Relational Targets in a Mapping

For relational targets, you can configure the following properties within a
mapping:

Reject truncated and overflow data. Select this option in the target instance
Properties tab when you want the Integration Service to write truncated data to
the reject file.
Update override. Override the default UPDATE statement using the SQL Editor
in the target instance Properties tab.
Table name prefix. Specify the owner of the target tables in the target instance
Properties tab.
Pre- and post-session SQL. Enter pre-session SQL commands for a target
instance in a mapping to execute commands against the target database before
the Integration Service reads the source. Enter post-session SQL commands to
execute commands against the target database after the Integration Service
writes to the target.
Target table name. You can override the default target table name.
Related Topics:
Working with Relational Targets in a Mapping

Configuring Flat File Targets in a Mapping

For flat file targets, you can configure the following properties within a mapping:

Datetime format. Define the default datetime format to use for datetime values.
Thousands separator. Define the default thousands separator to use for
numeric values.
Decimal separator. Define the default decimal separator to use for numeric
values.
Related Topics:
Defining Default Datetime and Numeric Formats

Configuring XML Targets in a Mapping

For XML targets, you can change the root element. However, if you change the
root, you affect the target XML structure and you can invalidate the mapping.

Setting the Target Load Order

You can configure the target load order for a mapping containing any type of
target definition. In the Designer, you can set the order in which the Integration
Service sends rows to targets in different target load order groups in a mapping.
A target load order group is the collection of source qualifiers, transformations,
and targets linked together in a mapping. You can set the target load order if you
want to maintain referential integrity when inserting, deleting, or updating tables
that have the primary key and foreign key constraints.

Figure 5-4 shows two target load order groups in one mapping:

Creating Target Files by Transaction

You can generate a separate output file each time the Integration Service starts a
new transaction. You can dynamically name each target flat file.

To generate a separate output file for each transaction, add a FileName port to
the flat file target definition. When you connect the FileName port in the mapping,
the Integration Service creates a separate target file at each commit. The
Integration Service names the output file based on the FileName port value from
the first row in each transaction. By default, the Integration Service writes output
files to $PMTargetFileDir.

Configuring the Target

You add the FileName column to a flat file target definition in the Target
Designer.

To add a FileName column:

1.Open the flat file target definition in the Target Designer.


2.Click the Columns tab.
3.Click Add FileName Column.

The Designer creates a string port called FileName. You can change the port
precision.

Configuring the Mapping

You can generate output files from source-based or user-defined commits. You
can use a source-based commit to commit data to a target file based on the
number of rows from a source. For example, you might want to create a separate
output file for each 1,000 rows of data. You can configure a user-defined commit
when the mapping contains an effective transaction generator. For example, you
might want to create a separate output file for each city.

In a mapping, connect the target FileName port to a transformation port that will
contain a unique value at the start of each transaction. You can create an
expression in the transformation to generate unique file names and pass them to
the FileName port.

Running the Session

When you configure a FileName port, the Integration Service overrides the
Output Filename session attribute with the value in the FileName column. If the
FileName column value is NULL for a row, the row is an error and the Integration
Service does not process it. If the FileName column is NULL after a transaction
boundary, the Integration Service names the output file with the default output file
name.

The FileName column must contain a unique value for each transaction. If the
FileName column value does not change between transactions, the Integration
Service overwrites the flat file target.

If you do not connect the FileName port in the mapping, the Integration Service
generates one target file and uses the output file name configured in the session.

Rules and Guidelines

Use the following rules and guidelines when you create FileName columns:
You can use a FileName column with flat file targets.
You can add one FileName column to the flat file target definition.
You can use a FileName column with data from real-time sources.
A session fails if you use a FileName column with merge files, file lists, or FTP
targets.
If you pass the same file name to targets in multiple partitions, you might get
unexpected results.
When a transformation drops incoming transaction boundaries and does not
generate commits, the Integration Service writes all rows into the same output
file. The output file name is the initial value of the FileName port.

Transaction Control transformation. Evaluates the New City value from the
Expression transformation. When New City is 1, the Transaction Control
transformation commits all orders in the transaction to the target. The
Transaction Control transformation passes the city and order number to the flat
file target. It also passes the city to the FileName column in the target.
Flat file target. Writes a new flat file for each transaction. The Integration
Service names each target with the value of FileName.

The Integration Services passes a transaction for each city to the target. For this
example, the data contains the following cities and order numbers:

Brisbane, 100

San Francisco, 101

San Francisco, 104

San Francisco, 105

San Francisco,107
Tiburon, 102

Tiburon, 106

Tiburon, 102

The Integration Service generates the following output files:

Brisbane

San Francisco

Tiburon

Validating a Mapping

When you develop a mapping, you must configure it so the Integration Service
can read and process the entire mapping. The Designer marks a mapping invalid
when it detects errors that will prevent the Integration Service from running
sessions associated with the mapping.

The Designer marks a mapping valid for the following reasons:

Connection validation. Required ports are connected and that all connections
are valid.
Expression validation. All expressions are valid.
Object validation. The independent object definition matches the instance in
the mapping.
Data flow validation. The data must be able to flow from the sources to the
targets without hanging at blocking transformations.

Connection Validation

The Designer performs connection validation each time you connect ports in a
mapping and each time you validate or save a mapping. When you connect
ports, the Designer verifies that you make valid connections. When you save or
validate a mapping, the Designer verifies that the connections are valid and that
all required ports are connected. When you save or validate a mapping, the
Designer makes the following connection validations:

At least one source and one target must be connected.


Source qualifiers must be mapped to a target.
Mapplets must be connected. At least one mapplet input port and output port
is connected to the mapping. If the mapplet includes a source qualifier that uses
an SQL override, the Designer prompts you to connect all mapplet output ports
to the mapping.
Datatypes between ports must be compatible. If you change a port datatype
to one that is incompatible with the port it is connected to, the Designer
generates an error and invalidates the mapping. For example, you have two
Date/Time ports connected, and you change one port to a Decimal. The
Designer invalidates the mapping. You can however, change the datatype if it
remains compatible with the connected ports, such as Char and Varchar.
Related Topics:
Connecting Mapping Objects

Expression Validation

You can validate an expression in a transformation while you are developing a


mapping. If you did not correct the errors, the Designer writes the error
messages in the Output window when you save or validate the mapping.

If you delete input ports used in an expression, the Designer marks the mapping
as invalid.

Object Validation

When you validate or save a mapping, the Designer verifies that the definitions of
the independent objects, such as sources or mapplets, match the instance in the
mapping. If any object changes while you configure the mapping, the mapping
might contain errors.

If any object changes while you are not configuring the mapping, the Designer
and other PowerCenter Client applications track the effects of these changes on
the mappings. The Repository Manager displays the status of mappings, so you
can see if a mapping is valid or not. If you notice that a mapping is invalid, you
can open the mapping and validate it to see the error messages in the Output
window.

Data Flow Validation

When you validate or save a mapping, the Designer verifies that the data can
flow from all sources in a target load order group to the targets without the
Integration Service blocking all sources.

Mappings that include blocking transformations might hang at runtime with any of
the following mapping configurations:

You connect one source pipeline to multiple input groups of the blocking
transformation.
You connect the sources and transformations in a target load order group in
such a way that multiple blocking transformations could possibly block all source
pipelines. Depending on the source data used in a session, a blocking
transformation might block data from one source while it waits for a row from a
different source.

When you save or validate a mapping with one of these configurations, the
Designer marks the mapping invalid. When the Designer marks a mapping
invalid because the mapping violates data flow validation, you must configure the
mapping differently, or use a non-blocking transformation where possible.
Mapping B in Figure 5-6 contains one multigroup transformation that blocks data,
MGT1. Blocking transformations can never block all input groups, so MGT1
might block either S1 or S2, but never both. MGT2 is not a blocking
transformation, so it will never block data. Therefore, this session will not hang at
runtime due to blocking. The Designer marks the mapping valid.

Steps to Validate a Mapping

You can validate a mapping while you are working on it through the Designer.
Also, when you click
Repository > Save, the Designer validates all mappings since the last time you
saved. When you validate or save a mapping the results of the validation appear
in the Output window. The Repository Manager also displays whether a mapping
is valid.

To validate a mapping, check out and open the mapping, and click Mappings >
Validate.

If the Output window is not open, click View > Output Window. Review any errors
to determine how to fix the mapping.

The following message is a sample mapping validation message in the Output


window:

------------------------------------------------------------------------

9/24/03 9:03:48 AM ** Validating mapping m_ItemSummaryPROD

-------------------------------------------------------------------------
Validating transformations of mapping m_ItemSummaryPROD...

...transformation validation completed with no errors.

Validating data flow of mapping m_ItemSummaryPROD...

...data flow validation completed with no errors.

Parsing mapping m_ItemSummaryPROD...

...parsing completed with no errors.

******** Mapping m_ItemSummaryPROD is VALID ********

Validating Multiple Mappings

You can validate multiple mappings without fetching them into the workspace. To
validate multiple mappings you must select and validate the mappings from
either a query results view or a view object dependencies list.

Note: If you use the Repository Manager, you can select and validate multiple
mappings from the Navigator.

You can save and optionally check in mappings that change from invalid to valid
status as a result of the validation.

To validate multiple mappings:

1.Select mappings from either a query or a view dependencies list.


2.Right-click one of the selected mappings and choose Validate.
The Validate Objects dialog box displays.
3.Choose whether to save objects and check in objects that you validate.

You might also like