Professional Documents
Culture Documents
Informatica PowerCenter9xLevel 1DeveloperLabGuide
Informatica PowerCenter9xLevel 1DeveloperLabGuide
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Informatica
PowerCenter 9x Level
One Developer
Lab Guide
Version: PowerCenter 9x Level One Developer 201201
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib 2, Informaticca and/or itssiiaffiliates.
bited. Copyrright© 2012
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Preface
The course will introduce attendees to working with the PowerCenter Designer,
Workflow Manager, and Workflow Monitor tools, performing tasks such as creating
transformations, mappings, reusable objects, sessions and workflows to extract, transform
and load data. They will develop cleansing, formatting, sorting and aggregating
procedures. They can learn how to use routers, update strategies, parameters /variables
and overrides. This course will cover many different types of lookups, such as cached,
persistent, dynamic and multiple row returns. Workflow tasks will be created to define a
set of instructions for executing the ETL.
Prerequisites:
Prerequisites include basic familiarity with Windows GUI and at least two years’ work
experience and some knowledge of SQL.
Course Objectives:
After successfully completing this course, students should be able to:
Use Informatica Support to resolve questions and problems with PC9.x.
Use PowerCenter 9.x Designer to build mappings that extract data from a source
to a target, transforming it as necessary.
Use PowerCenter transformations to cleanse, format, join, aggregate and route
data to the appropriate targets
Perform error handling/trapping using PowerCenter mappings
Use PowerCenter 9.x Workflow Manager to build and run a workflow which
executes a sessions associated with a mapping
Design and build simple mappings and workflows based on essential business
needs.
Perform basic troubleshooting using PowerCenter logs and debugger
Audience:
This course is designed for database developers with little or no experience of
PowerCenter.
.
Un
nauthorized
d reproductio
on or distrib
bution prohib 2, Informaticca and/or itssiiiaffiliates.
bited. Copyrright© 2012
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Document Conventions
This guide uses the following formatting conventions:
If you see… It means… Example
> Indicates a submenu to navigate Click Repository > Connect.
to. In this example, you should click the
Repository menu or button and choose
Connect.
boldfaced text Indicates text you need to type or Click the Rename button and name the new
enter. source definition S_EMPLOYEE.
UPPERCASE Database tables and column names T_ITEM_SUMMARY
are shown in all UPPERCASE.
italicized text Indicates a variable you must Connect to the Repository using the assigned
replace with specific information. login_id.
Note: The following paragraph provides Note: You can select multiple objects to
additional facts. import by using the Ctrl key.
Tip: The following paragraph provides Tip: The m_ prefix for a mapping name is…
suggested uses or a Velocity best
practice.
Un
nauthorized
d reproductio
on or distrib
bution prohib 2, Informaticca and/or itssivaffiliates.
bited. Copyrright© 2012
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Other Informatica Resources
In addition to the student guides, Informatica provides these other resources:
Informatica Documentation
Informatica Customer Portal
Informatica web site
Informatica Developer Network
Informatica Knowledge Base
Informatica Professional Certification
Informatica Technical Support
Obtaining Informatica Documentation
You can access Informatica documentation from the product CD or online help.
Visiting Informatica Customer Portal
As an Informatica customer, you can access the Informatica Customer Portal site at
http://communities.informatica.com
The site contains product information, user group information, newsletters, access to the
Informatica customer support case management system (ATLAS), the Informatica Knowledge
Base, and access to the Informatica user community.
Visiting the Informatica Web Site
You can access Informatica’s corporate web site at:
http://www.informatica.com
The site contains information about Informatica, its background, upcoming events, and locating your
closest sales office. You will also find product information, as well as literature and partner
information. The services area of the site includes important information on technical support,
training and education, and implementation services.
Visiting the Informatica Technology Network
The Informatica Developer Network is a web-based forum growing online community and
interactive forum for data integration and data quality professionals around the globe. You can access
the Informatica Developer Network at the following URL:
http://technet.informatica.com/
The site contains information on how to create, market, and support customer-oriented add-on
solutions based on interoperability interfaces for Informatica products.
Visiting the Informatica Knowledge Base
As an Informatica customer, you can access the Informatica Knowledge Base at:
http://communities.informatica.com
The Knowledge Base lets you search for documented solutions to known technical issues about
Informatica products. It also includes frequently asked questions, technical white papers, and
technical tips.
Obtaining Informatica Professional Certification
You can take, and pass, exams provided by Informatica to obtain Informatica Professional
Certification. For more information, go to:
http://www.informatica.com/products_services/education_services/certification/Pages/index.aspx
Un
nauthorized
d reproductio
on or distrib
bution prohib 2, Informaticca and/or itssvaffiliates.
bited. Copyrright© 2012
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Providing Feedback
Email any comments on this guide to education@informatica.com.
WebSupport requires a user name and password. You can request a user name and password at:
http://communities.informatica.com
Un
nauthorized
d reproductio
on or distrib
bution prohib 2, Informaticca and/or itssviaffiliates.
bited. Copyrright© 2012
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Table of Contents
Lab 2.1: Create STG_Dealership Mapping .................................................................................................... 1
Lab 2.2: Create STG Payment Mapping ...................................................................................................... 11
Lab 2.3: Create ODS Payment Mapping ...................................................................................................... 23
Lab 2.4: Create STG_Dealership Workflow ................................................................................................. 31
Lab 2.5: Create STG Payment Workflow ..................................................................................................... 39
Lab 2.6: Create ODS Payment Workflow .................................................................................................... 47
Lab 2.7: Log Events Review ......................................................................................................................... 53
Lab 3: TroubleShooting ............................................................................................................................... 57
Lab 4.1: Load STG Customer Target ............................................................................................................ 71
Lab 4.2: Load the STG Employees Target .................................................................................................... 87
Lab 5.1: Using Homogeneous Joins to load the STG Product Target .......................................................... 99
Lab 5.2: Using Heterogeneous Joins and Link Conditions to load the STG Transactions Target .............. 105
Lab 6: Features and Techniques ............................................................................................................... 115
Lab 7: Using the Debug Wizard ................................................................................................................. 121
Lab 8.1: Using a Lookup to load the ODS Employee Target ...................................................................... 131
Lab 8.2: Using a Sequence Generator to load ODS Dates Target ............................................................. 147
Lab 8.3: Creating a Lookup Cache and loading the ODS Promotions Target ............................................ 153
Lab 9: Updating Targets Using PowerCenter ............................................................................................ 161
Lab 10.1: Using PowerCenter to load the Fact Sales Target ..................................................................... 181
Lab 10.2: Create a Mapplet ....................................................................................................................... 193
Lab 11: Using Workflow Variables and Tasks to load a Weekly Aggregate Target ................................... 197
Lab 12.1: Using Parameter Files to load STG Employees Target .............................................................. 205
Lab 12.2: Using Parameter Files to load the DIM Employees Target........................................................ 217
Lab 13.1: Using a Dynamic Lookup and Error Logging to load the DIM Customers Target ...................... 225
Lab 13.2: Error Handling ........................................................................................................................... 235
Lab 14: More Lookups ............................................................................................................................... 247
Lab 15: Mapping Workshop ...................................................................................................................... 255
Lab 16: Workflow Workshop I .................................................................................................................. 263
Lab 17: Workflow Workshop II ................................................................................................................. 271
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
PowerCenter includes two development applications, the Designer, which you will
use to create mappings, and the Workflow Manager, which you will use later to
create and start workflows. This exercise is designed to serve as your first hands-on
experience with PowerCenter, and supplement the instructor demonstrations. You
will import source and target definitions from the database as well as create shortcuts
from the Dev_Shared folder. You will create a pass-through mapping.
Goals:
Learn how to navigate the repository folder structure.
Understand the purpose of the tools accessed from the Designer.
Create and save source and target definitions and shortcuts.
Learn how to access and edit the database connections objects.
Create simple pass-through mapping.
Duration:
15 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.1 bited. Copyrright© 2012
- m_STG_DEALERSHIP_xx 2, Informaticca and/or itss 1affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Note: Throughout this and later exercises, xx will refer to the student number assigned to
you by your Instructor or the machine you are working on. For example, if you are
Student05, then DEVxx refers to the folder DEV05.
Step 1. Start PowerCenter Designer
Un
nauthorized
2 d reproductio
on or distrib
bution prohib
Lab 2.1- bited. Copyrright© 2012
m_STG_DEALERSHIP_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) Right-click the folder labeled Devxx and select Open.
Figure 3: Open the Folder
Note: Note the small toolbar directly to the right of the Navigator window, at the top.
There are the five Designer tools. Each tool allows you to create and modify one
specific type of object, such as sources. Figure 4 shows the Designer tools with the
first tool (the Source Analyzer) selected.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.1 bited. Copyrright© 2012
- m_STG_DEALERSHIP_xx 2, Informaticca and/or itss 3affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
c) Owner Name and Password are SDBU as well.
d) Click the Connect button.
e) Expand the Tables node.
f) Select the DEALERSHIP table.
g) The Import Tables dialog should appear the same as displayed in Figure 5
below.
Figure 5: Completed Import Tables from Database dialog box
Note: You can select multiple objects for simultaneous import by using the Ctrl key.
h) Click OK.
The DEALERSHIP source definition will appear in the Source Analyzer
workspace as shown in Figure 6 below:
Un
nauthorized
4 d reproductio
on or distrib
bution prohib
Lab 2.1- bited. Copyrright© 2012
m_STG_DEALERSHIP_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
View the bottom left pane of the Designer. This is the Output Window. You will
see a notification that the source was successfully saved.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.1 bited. Copyrright© 2012
- m_STG_DEALERSHIP_xx 2, Informaticca and/or itss 5affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 9: Completed Import Tables from Database dialog box
h) Click OK.
The STG_DEALERSHIP source definition will appear in the Source
Analyzer workspace as shown in Figure 6 below:
Un
nauthorized
6 d reproductio
on or distrib
bution prohib
Lab 2.1- bited. Copyrright© 2012
m_STG_DEALERSHIP_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 4. Create a Mapping
1) Open the Mapping Designer by clicking the respective icon in the toolbar. The
icon is shown highlighted below:
Figure 12: Designer Tools – Target Designer
Velocity Best Practices: The m_ as a prefix for a mapping name is specified in the
Informatica Velocity Best Practices. Mappings names should be clear and
descriptive so that others can immediately understand the purpose of the mappings.
Velocity suggests either the name of the targets being accessed or a meaningful
description of the function of the mapping.
Note: Two objects will appear on the Mapping Designer. By default, the Source
definition along with the Source Qualifier will by dragged out onto the workspace.
This default behavior can be changed by selecting Tools Options Tables and
de-selecting Create Source Qualifiers when opening sources
4) Expand the Targets subfolder, and drag and drop the target
STG_DEALERSHIP onto the Mapping Designer.
a) Your mapping should appear as displayed on Figure 13:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.1 bited. Copyrright© 2012
- m_STG_DEALERSHIP_xx 2, Informaticca and/or itss 7affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
b) Connect all other ports of the Source Qualifier and the target definition as
described above in the following fashion:
Figure 14: Ports to link between DEALERSHIP and STG_DEALERSHIP
SQ_DEALERSHIP DEALERSHIP
DEALERSHIP_MANAGER_ID DEALERSHIP_MANAGER_ID
DEALERSHIP_DESC DEALERSHIP_DESC
DEALERSHIP_LOCATION DEALERSHIP_LOCATION
DEALERSHIP_STATE DEALERSHIP_STATE
DEALERSHIP_REGION DEALERSHIP_REGION
DEALERSHIP_COUNTRY DEALERSHIP_COUNTRY
6) When you are done linking the ports, right-click within the mapping area and
select the menu option Arrange All.
a) You mapping should appear as follows:
Figure 15: Linked m_STG_DEALERSHIP_xx Mapping
Un
nauthorized
8 d reproductio
on or distrib
bution prohib
Lab 2.1- bited. Copyrright© 2012
m_STG_DEALERSHIP_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
7) Type Ctrl-S to save your work to the repository.
8) Confirm that your Output window displays the message below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.1 bited. Copyrright© 2012
- m_STG_DEALERSHIP_xx 2, Informaticca and/or itss 9affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
10 d reproductio
on or distrib
bution prohib
Lab 2.1- bited. Copyrright© 2012
m_STG_DEALERSHIP_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The student will create the flat file source for Payments. Then a relational target
definition will be created. After this is saved to the repository, the DDL will get
generated and executed on the database. The student will verify that the physical
table does exist, and then create the mapping.
Goals:
Learn how to create a mapping that loads from a flat file to a relational table.
Learn how to create a source definition from a flat file.
Learn how to create a relational stage target from a source definition.
Create a physical database table using DDL generated from PowerCenter.
Create simple pass-through mapping.
Duration:
30 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.2 – m_STG_PAYMENT_xx 2, Informaticca and/or itss11affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Start PowerCenter Designer
1) If you are not already logged into PowerCenter, please double-click the
Un
nauthorized
12 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.2 - m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) Right-click the folder labeled Devxx and select Open.
Figure 3: Open the Folder
Note: Note the small toolbar directly to the right of the Navigator window, at the top.
There are the five Designer tools. Each tool allows you to create and modify one
specific type of object, such as sources. Figure 4 shows the Designer tools with the
first tool (the Source Analyzer) selected.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.2 – m_STG_PAYMENT_xx 2, Informaticca and/or itss13affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
b) Locate the c:\Infa_Shared\SrcFiles\payment.txt. If the file is located in a
different directory the instructor will specify.
Figure 5: Open Flat File Dialog:
c) Click Open.
d) The Flat File Import Wizard appears.
e) Confirm that the Delimited option button is selected.
f) Select the Import Field Names from the first line checkbox.
g) The Wizard should appear as displayed below:
Figure 6: Flat File Wizard – Step 1 of 3:
Un
nauthorized
14 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.2 - m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
h) Click Next.
i) Confirm that only the Comma check box under Delimiters is selected.
j) Select the No Quotes button under Text Qualifier.
k) Click Next.
l) Confirm that the field names are displayed under Column Information.
These were imported from the first line of the flat file.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.2 – m_STG_PAYMENT_xx 2, Informaticca and/or itss15affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
m) Click Finish.
n) The flat file definition should appear on your Source Analyzer workspace as
shown below:
Figure 9: Flat File Source Definition - Payment
2) Right-click anywhere in the Target Designer workspace and select Clear All.
3) In the Navigator window, open the Sources folder.
4) Open the FlatFiles subfolder
5) Select the payment source definition as shown below:
Un
nauthorized
16 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.2 - m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
b) Double-click the Target definition.
c) Select the Rename button.
d) Rename the target definition to STG_PAYMENT.
e) Select the Database Type drop down and select Oracle as shown below.
Figure 12: Target Definition – STG_PAYMENT:
f) Click OK.
i) Observe the Target folder of your repository folder in the Navigator window
and note that the STG_PAYMENT target has been added.
Figure 13: Navigator window – Repository folder
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.2 – m_STG_PAYMENT_xx 2, Informaticca and/or itss17affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 4. Create the physical Payment Database table.
1) From the menu, select Targets Generate/Execute SQL.
a) Select the Connect button.
b) At the ODBC data source drop down, select STG.
c) Username is STGxx. Password is the same. As shown below:
Figure 14: ODBC Data Source:
The physical target table STG_PAYMENT will be created within the STGxx schema
of your Oracle database.
Un
nauthorized
18 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.2 - m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
d) Select Generate SQL file.
e) Note that the Output window confirms that the file has been created.
f) Select Edit SQL File. The file should appear as displayed below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.2 – m_STG_PAYMENT_xx 2, Informaticca and/or itss19affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 18: SQL Developer Application:
g) You have just verified that the physical table has been created and committed
on the physical database.
h) Close the SQL Developer application.
Un
nauthorized
20 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.2 - m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 6. Create a Mapping
1) Open the Mapping Designer by clicking the respective icon in the toolbar. The
icon is shown highlighted below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.2 – m_STG_PAYMENT_xx 2, Informaticca and/or itss21affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
5) Confirm that your Output window displays the message below:
Un
nauthorized
22 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.2 - m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The student will create and use a shortcut to the DEV_SHARED folder for
ODS_PAYMENT. The student will then create a mapping that loads data from the
STG_PAYMENT table to the ODS_PAYMENT table.
Goals:
Learn how to create a shortcut to a shared target definition.
Reinforce import of relational sources lesson.
Create simple pass-through mapping.
Duration:
10 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.3 – m_ODS_PAYMENT_xx 2, Informaticca and/or itss23affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Start PowerCenter Designer
1) If you are not already logged into PowerCenter, please double-click the
Un
nauthorized
24 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.3 – m_ODS_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) Right-click the folder labeled Devxx and select Open.
Figure 3: Open the Folder
Note: Note the small toolbar directly to the right of the Navigator window, at the top.
There are the five Designer tools. Each tool allows you to create and modify one
specific type of object, such as sources. Figure 4 shows the Designer tools with the
first tool (the Source Analyzer) selected.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.3 – m_ODS_PAYMENT_xx 2, Informaticca and/or itss25affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
d) Select the STG_PAYMENT table
e) The Import Table dialog box should appear as displayed below:
f) Click OK.
g) Click Cntl-S to save the source to the repository.
h) Verify in the Output window that source STG_PAYMENT saved
successfully.
2) Right-click anywhere in the Target Designer workspace and select Clear All.
3) In the Navigator window, connect to the DEV_SHARED folder using a single-
click.
Note: it is important that the DEV_SHARED folder is only connected not open
in order to do a shortcut. You will know that the DEV_SHARED folder is
merely connected because it is not bolded and it is not listed in the folder drop
down as shown in the figure below:
Un
nauthorized
26 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.3 – m_ODS_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 6: Connected DEV_SHARED folder:
e) Click Yes.
f) Click Ctrl-S to save the shortcut to the repository.
g) Use the Output window to verify that the shortcut saved successfully to the
repository:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.3 – m_ODS_PAYMENT_xx 2, Informaticca and/or itss27affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
h) The ODS_PAYMENT shortcut should appear as shown below with a small
curved arrow on the upper left of the object:
Un
nauthorized
28 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.3 – m_ODS_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 8: ODS_Payment Mapping
6) Use your Output window to confirm the mapping saved successfully to the
repository.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
2.3 – m_ODS_PAYMENT_xx 2, Informaticca and/or itss29affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
30 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
2.3 – m_ODS_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
PowerCenter includes two development applications, the Designer, which you have
already used create mappings, and the Workflow Manager, which you will use to
create and start workflows. This exercise is designed to serve as your first hands-on
experience with PowerCenter, and supplement the instructor demonstrations.
Goals:
Understand the purpose of the tools accessed from the Workflow Manager.
Create Session tasks to run the mappings and configure connectivity.
Create Workflows to run the Session tasks.
Execute the Workflows and monitor the results.
Duration:
15 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 2. prohib bited. Copyrright© 2012
4 - wf_m_STG_DEALERSHIP_xx 2, Informaticca and/or itss31affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Workflow and a Session Task
1) Launch the Workflow Manager by clicking on the respective icon in the toolbar.
The icon is shown highlighted below:
2) Open the Workflow Designer workspace by clicking the respective icon in the
toolbar. The icon is shown highlighted below:
b) Grab the handle of the Task Toolbar and pull it to the left so that it is easily
accessible.
Un
nauthorized
32 d reproductio
on or distrib
bution
Lab 2.4prohibbited. Copyrright© 2012
- wf_m_STG_DEALERSHIP_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
5) Create the Session task.
a) Click on the Session icon on the toolbar. The icon is shown highlighted
below:
d) Select the Start Task and drag the link to the Session task.
e) When completed the workflow should appear as follows:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 2. prohib bited. Copyrright© 2012
4 - wf_m_STG_DEALERSHIP_xx 2, Informaticca and/or itss33affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
(iv) The Relational Connection Browser will appear. Select the Oracle
connection SDBU.
h) In the Connections area on the right, select the drop down arrow under DB
Connections section.
j) Click OK.
k) In the Properties section, change the Target Load Type to Normal as shown
below.
Un
nauthorized
34 d reproductio
on or distrib
bution
Lab 2.4prohibbited. Copyrright© 2012
- wf_m_STG_DEALERSHIP_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 8: Edit Tasks – Target Properties
l) Select Connections on the left side of the Edit Tasks screen. The screen
should appear as shown below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 2. prohib bited. Copyrright© 2012
4 - wf_m_STG_DEALERSHIP_xx 2, Informaticca and/or itss35affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 9: Edit Tasks Dialog for s_m_STG_DEALERSHIP_xx:
m) Click OK.
Un
nauthorized
36 d reproductio
on or distrib
bution
Lab 2.4prohibbited. Copyrright© 2012
- wf_m_STG_DEALERSHIP_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
The completed session run properties should display as shown below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 2. prohib bited. Copyrright© 2012
4 - wf_m_STG_DEALERSHIP_xx 2, Informaticca and/or itss37affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 12: Data Preview of the STG_DEALERSHIP target table:
Un
nauthorized
38 d reproductio
on or distrib
bution
Lab 2.4prohibbited. Copyrright© 2012
- wf_m_STG_DEALERSHIP_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The student will create the workflow for STG_Payments.
Goals:
Understand the purpose of the tools accessed from the Workflow Manager.
Create Session tasks to run the mappings and configure connectivity.
Create Workflows to run the Session tasks.
Execute the Workflows and monitor the results.
Duration:
15 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.5 bited. Copyrright© 2012
– wf_m_STG_PAYMENT_xx 2, Informaticca and/or itss39affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Workflow and a Session Task
1) If you are not already logged into the Workflow Manager, launch the application
by clicking on the respective icon in the toolbar. The icon is shown highlighted
below:
2) Open the Workflow Designer workspace by clicking the respective icon in the
toolbar. The icon is shown highlighted below:
c) The Mappings List dialog with a list of mappings to associate with your
session task will appear. Choose the m_STG_PAYMENT_xx mapping.
Un
nauthorized
40 d reproductio
on or distrib
bution
Lab 2.prohibbited. Copyrright© 2012
5 – wf_m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
d) Click OK.
(ii) Select the Source Qualifier icon SQ_PAYMENT (in the Session
properties navigator window).
(iii) Scroll down in the Properties section on the right-side of the Edit Tasks
window. Make sure the Source File Directory is set to
$PMSourceFileDir \ and the Source FileName is set to payment.txt as
shown in the figure below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.5 bited. Copyrright© 2012
– wf_m_STG_PAYMENT_xx 2, Informaticca and/or itss41affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 4: Mapping Tab of s_m_STG_PAYMENT_xx Session:
i) In the Connections area on the right, select the drop down arrow under DB
Connections section.
k) Click OK.
l) In the Properties section, change the Target Load Type to Normal as shown
below.
Un
nauthorized
42 d reproductio
on or distrib
bution
Lab 2.prohibbited. Copyrright© 2012
5 – wf_m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 5: Edit Tasks – Target Properties
m) Select Connections on the left side of the Edit Tasks screen. The screen
should appear as shown below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.5 bited. Copyrright© 2012
– wf_m_STG_PAYMENT_xx 2, Informaticca and/or itss43affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
n) Click OK.
o) Click Ctrl-S to save the workflow to the repository.
6) Start the Workflow.
a) Right-click anywhere in the Workflow Designer workspace and select Start
Workflow.
b) Right-click on s_m_STG_PAYMENT _xx and select Get Run Properties.
Un
nauthorized
44 d reproductio
on or distrib
bution
Lab 2.prohibbited. Copyrright© 2012
5 – wf_m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.5 bited. Copyrright© 2012
– wf_m_STG_PAYMENT_xx 2, Informaticca and/or itss45affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
46 d reproductio
on or distrib
bution
Lab 2.prohibbited. Copyrright© 2012
5 – wf_m_STG_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The student will create a workflow that loads data from the STG_PAYMENT table to
the ODS_PAYMENT table.
Goals:
Create Session tasks to run the mappings and configure connectivity.
Create Workflows to run the Session tasks.
Execute the Workflows and monitor the results.
Duration:
10 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.6 bited. Copyrright© 2012
– wf_m_ODS_PAYMENT_xx 2, Informaticca and/or itss47affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Workflow and a Session Task
1) If you are not already logged into the Workflow Manager, launch the application
by clicking on the respective icon in the toolbar. The icon is shown highlighted
below:
2) Open the Workflow Designer workspace by clicking the respective icon in the
toolbar. The icon is shown highlighted below:
b) Click OK.
Un
nauthorized
48 d reproductio
on or distrib
bution
Lab 2.prohib
bited. Copyrright© 2012
6 – wf_m_ODS_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
e) Link the Start task to the session s_m_ODS_PAYMENT_xx.
f) When completed the workflow should appear as follows:
(ii) Select the Source Qualifier icon SQ_STG_PAYMENT (in the Session
properties navigator window).
(iv) Select the Connections node. Your screen should appear as displayed
below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.6 bited. Copyrright© 2012
– wf_m_ODS_PAYMENT_xx 2, Informaticca and/or itss49affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 4: Mapping Tab of Session Task – s_m_ODS_PAYMENT_xx:
h) Click OK.
Un
nauthorized
50 d reproductio
on or distrib
bution
Lab 2.prohib
bited. Copyrright© 2012
6 – wf_m_ODS_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 5: Run Properties – s_m_ODS_PAYMENT_xx
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 2.6 bited. Copyrright© 2012
– wf_m_ODS_PAYMENT_xx 2, Informaticca and/or itss51affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
52 d reproductio
on or distrib
bution
Lab 2.prohib
bited. Copyrright© 2012
6 – wf_m_ODS_PAYMENT_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The student will use the Workflow Monitor to access the Workflow and Session logs
of the last workflow and familiarize themselves with all the valuable information
included there.
Goals:
Learn how to access the Workflow and Session logs in the Workflow Monitor.
Identify memory allocations.
Learn location of workflow names, folder names, and Integration Service names
within both workflow and session logs.
Identify SQL Statements.
Duration:
15 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
bited.
Lab 2.7Copyrright© 2012
2, Informaticca and/or itss53affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Access the Workflow and Session Logs
If you are not already logged into the Workflow Monitor, launch the application
by clicking on the respective icon in the toolbar.
1) The wf_m_ODS_PAYMENT_xx workflow should already be open within the
workspace.
Un
nauthorized
54 d reproductio
on or distrib
bution prohib
bited.
Lab 2.7Copyrright© 2012
2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
bited.
Lab 2.7Copyrright© 2012
2, Informaticca and/or itss55affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
a) Note the start of the session and the target table listed.
b) Note the SQL Query against the source.
c) Note the start and end times of the session
d) Note the Load Summary and the number of inserts, applied, rejected and
affected records.
8) Close the Session Events Log.
Un
nauthorized
56 d reproductio
on or distrib
bution prohib
bited.
Lab 2.7Copyrright© 2012
2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Lab 3: TroubleShooting
Scenario:
Now that you have some experience, your Tech Lead has given you three flawed
workflows that have errors in need of correction.
Technical Description:
The student will copy mappings from the DEV_SHARED folder and correct the
errors associated with them.
Goals:
Learn how to copy mappings and workflows from a shared area.
Identify errors within a mapping and workflow.
Learn how to use the PowerCenter interfaces and logs to identify errors.
Learn how to correct the errors in the mapping associated with a workflow.
Duration:
45 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2, Informaticca and/or itss57affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Start the PowerCenter Repository Manager
1) From within the PowerCenter Designer, please click the PowerCenter Repository
Manager icon the toolbar to start it.
2) PowerCenter will log you into the Repository Manager with the Devxx login
used to log into the Designer.
3) PowerCenter will automatically open your folder.
Un
nauthorized
58 d reproductio
on or distrib
bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 1: Dev_Shared wf_m_Errors1_xx Workflow:
e) Click Yes.
f) Note the Copy Messages in the Output Window of the Repository Manager.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2, Informaticca and/or itss59affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 3: Copy Messages in Output Window:
d) Note that the Error Mappings, Sources and Targets now exist in your folder.
Un
nauthorized
60 d reproductio
on or distrib
bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
f) Select the menu option Mappings Edit.
h) Click OK.
j) Use the Output window to verify the mapping saved successfully to the
repository.
1) If you are not already logged into the Workflow Manager, launch the application
by clicking on the respective icon in the toolbar.
2) Log into the Repository with your Devxx login.
3) Open your folder.
4) Navigate to the Workflow Designer using the Workflow Tools Toolbar.
5) If a workflow exists on the workspace, use menu option Workflows Close to
clear the workspace.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2, Informaticca and/or itss61affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 3. Trouble Shoot a Session Failure
1) Use the drop down list next to the Workflow Designer Toolbar to open
wf_m_Errors1_xx as shown in the figure below:
Un
nauthorized
62 d reproductio
on or distrib
bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
g) Click OK.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2, Informaticca and/or itss63affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
e) Right-click on the s_m_Errors1_xx session and select Get Session Log.
Note the error message:
5) When there is no Session Log, the next thing to do is look at the Workflow Log.
b) Note that the Workflow log shows the same error as the Session Task Details
and other errors as well.
6) Double-click the s_m_Errors1_xx session task and select the Mapping tab.
Un
nauthorized
64 d reproductio
on or distrib
bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Note: The lookups access the Product_Cost and Payment_ID tables in the SDBU
schema. The lookups are set to use the $Source connection variable. However,
this variable is currently undefined.
b) Edit the session and set $Source to connection SDBU in the Connections
node of the navigation panel. As shown below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2, Informaticca and/or itss65affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
c) Click OK.
Un
nauthorized
66 d reproductio
on or distrib
bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 4. Debugging an Unknown Error
1) Drag the workflow wf_Error2_xx onto the Workflow Manager Workflow
Designer workspace.
Note: It’s possible to look at the First Error Attribute Value and get some
direction on where to look for the problem.
Lets open the mapping and take a look at the SQL relationship.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2, Informaticca and/or itss67affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
8) Click on the Properties tab.
Note that the relationship has been entered into the SQL Query value. That is
wrong. A relationship declaration should be entered into the User Defined Join
value.
14) A successful execution will result in Task Details and Source/Target Statistics
like the figure below:
Un
nauthorized
68 d reproductio
on or distrib
bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2, Informaticca and/or itss69affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 7: Session Failure with Database error:
5) Note: a session will fail if the target table has an index on it and the Target Load
Type of the session is set to ‘Bulk’.
Alternatively, you could have used the pre/post SQL in the mapping/session to
drop and rebuild the indexes during a session run.
Un
nauthorized
70 d reproductio
on or distrib
bution prohib
Lab 3bited. Copyrright© 2012
Troubleshooting 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
PowerCenter will source from a file list. This file list contains the names of three
delimited flat files from the regional sales offices. All rows with a customer number
99999 will need to be filtered out. There are a number of columns that will need to
have the data reformatted, this will include substrings, concatenation and decodes.
Goals:
Create a filter transformation to eliminate unwanted rows form a flat file source.
Create an Expression transformation to reformat incoming rows before they are
written to a target.
Use the DECODE function as a small lookup to replace values for incoming data
before writing to target.
Create a session task that will accept and process a file list as a source.
Create a workflow
Duration:
60 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2, Informaticca and/or itss71affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Flat File Source Definition
1) If you are not already logged into PowerCenter, please double-click the
Tip: Only one flat file definition is required when using a file lit as a source
in PowerCenter. All the files that make up the file list must have the same
identical layout in order for the file list to be successfully processed by
PowerCenter.
Un
nauthorized
72 d reproductio
on or distrib
bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
d) Click Ctrl-S to save your work to the repository.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2, Informaticca and/or itss73affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
74 d reproductio
on or distrib
bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) Link the following ports from the Source Qualifier to the Filter:
CUSTOMER_NO
FIRSTNAME
LASTNAME
ADDRESS
CITY
STATE
ZIP
COUNTRY
PHONE_NUMBER
GENDER
INCOME
EMAIL
AGE
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2, Informaticca and/or itss75affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
6) Click the dropdown arrow for the Filter Condition Transformation Attribute to
active the Expression Editor.
7) Remove the TRUE condition from the Expression Editor.
8) Enter the following expression:
a) CUSTOMER_NO != 99999 OR ISNULL(CUSTOMER_NO)
Un
nauthorized
76 d reproductio
on or distrib
bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 5. Create an Expression Transformation
1) Create an Expression transformation directly after the Filter transformation.
Select the Expression transformation tool button located on the Transformation
tool bar and place it in the workspace directly after the Filter. The icon is shown
highlighted below:
2) Select the following ports from the Filter transformation and pass them to the
Expression transformation:
FIRSTNAME
LASTNAME
PHONE_NUMBER
GENDER
AGE
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2, Informaticca and/or itss77affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Port Name Datatype Precision Expression
OUT_CUST_NAME String 41 IN_FIRSTNAME || ‘ ‘ || IN_LASTNAME
This new port will concatenate the FIRSTNAME and LASTNAME ports
into a single string. Do not use the CONCAT in expressions. Use || to
achieve concatenation. The CONCAT function is only available for
backward compatibility.
Velocity Best Practice: Prefixing input only ports with IN_ and output ports
with OUT_ is a Velocity Best Practice. This makes it easier to tell what the ports
are without having to open the transformation.
The expression above uses nesting to call the TO_CHAR function from
within the SUBSTR function. The TO_CHAR function is performed first.
The SUBSTR function is then performed against the return value from
TO_CHAR.
Un
nauthorized
78 d reproductio
on or distrib
bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
<= 60, '50 TO 60', AGE > 60, 'GREATER
THAN 60')
This DECODE function assigns the appropriate age group level to each
customer based on their age. DECODE used in this manner tests multiple
columns and conditions, evaluated in a top to bottom order for TRUE or
FALSE.
f) Click OK.
6) Link the Expression Transformation to the Target .
exp_FORMAT_NAME_GENDER_PHONE SC_STG_CUSTOMER
AGE CUST_AGE
OUT_CUST_NAME CUST_NAME
OUT_CUST_PHONE CUST_PHONE_NMBR
OUT_GENDER CUST_GENDER
OUT_AGE_GROUP CUST_AGE_GROUP
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2, Informaticca and/or itss79affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
80 d reproductio
on or distrib
bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
d) A list of available mappings (in this case, choose
m_STG_CUSTOMER_CONTACTS_xx) should automatically appear.
e) After choosing the mapping, the workflow will be automatically created for
you using the name of the mapping
(wf_m_STG_CUSTOMER_CONTACTS_xx). The start task will appear
already linked to the properly named session. Good stuff!
Tip: The source instance you are reading is known as a File List. It is a list of
files which will be appended together and treated as one source file by
PowerCenter. The name of the text file that is listed in Properties | Attributes |
Source Filename will be a test file that contains a list of the test files to be read in
as individual sources. When you create a file list you open a blank test file with
an application such as Notepad and type on a separate line each text file that is to
be read as part of the file list. You may precede each file name with directory
path information. If you don’t provide the directory path, PowerCenter assumes
the files will be located in the same directory as the file list file.
Tip: When you use the file list feature in PowerCenter you have to set
Properties | Attributes | Source Filetype to Indirect so that PowerCenter will
understand to read this file as a list and not as a direct source.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2, Informaticca and/or itss81affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
e) Your screen should appear similar to the figure below:
Figure 7: Completed Session Task Source Properties:
The file list used in this exercise lists three test files which are found in the
default location of the file list file, $PMSourceFileDir\. The figure below
displays the contents of customer _list.dat.
Un
nauthorized
82 d reproductio
on or distrib
bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
5) Under the Components Tab
a) Change the ‘On-Success Email’ Type to Non-reusable.
b) Select the Value edit button
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2, Informaticca and/or itss83affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 10: Edit Success Email:
Note: you do not have to type in the qualifiers (i.e. ‘Workflow Name =’). These
qualifiers are included in the variable (%w).
Workflow Name = %w
Session name = %s
Session Start Time = %b
Session Completed Time = %c
Total Records Loaded = %l
Total Records Rejected = %r
Un
nauthorized
84 d reproductio
on or distrib
bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
h) Your email text should appear as shown below:
i) Click OK
j) Optional - Configure an On-Failure email.
k) Click OK.
l) Save the workflow.
7) If your session failed or had errors troubleshoot and correct them by reviewing
the session log and make any necessary changes to your mapping or workflow.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2, Informaticca and/or itss85affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
8) Check your email
a) Login to Windows Live Mail. Programs Windows Live Mail
b) User name = Studentxx@infa-server.com.
c) Password = Studentxx
d) Your inbox should show an on-success email as seen below:
Un
nauthorized
86 d reproductio
on or distrib
bution
Lab 4.1 prohib
bited. Copyrright© 2012
– m_STG_Customer_Contacts_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
PowerCenter will source from a file list. The file list contains the names of three
delimited flat files from the regional sales offices. All rows with a customer number
of 99999 will need to be filtered out. There are a number of columns that will needs
to have the data reformatted according to the company’s business rules. The
functions used to reformate the data include substring, concatenation and decodes.
Goals:
Create and use a Reusable Transformation.
Practice using File Lists.
Practice using Session Email functionality.
Duration:
30 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2, Informaticca and/or itss87affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Flat File Source Definition
1) If you are not already logged into PowerCenter, please double-click the
Un
nauthorized
88 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 2. Create a Relational Target Definition
1) Create a shortcut to the STG_EMPLOYEES definition from the DEV_SHARED
folder in your folder. Name the shortcut SC_STG_EMPLOYEES.
2) Confirm that your target definition appears the same as displayed in the figure
below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2, Informaticca and/or itss89affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 3: Transformation Edit dialog box showing how to make a transformation reusable:
Un
nauthorized
90 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
3) Review the Transformation dialog box. What differences do you see?
a) Select the Ports tab. Can you change anything here? Why are you unable to
make changes?
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2, Informaticca and/or itss91affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 4. Create a mapping
1) Open the Mapping Designer.
2) If a mapping is visible in the workspace, close it by selected menu option
Mappings Close.
3) Create a new mapping named m_STG_EMPLOYEES_xx.
4) Add the employees_layout file source to the mapping
5) Add SC_STG_EMPLOYEES target to the mapping.
6) Your mapping will appear similar to the figure below
Un
nauthorized
92 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
NATIVE_LANGUAGE NATIVE_LANG_DESC
SECOND_LANGUAGE SEC_LANG_DESC
THIRD_LANGUAGE TER_LANG_DESC
POSITION_TYPE POSITION_TYPE
DEALERSHIP_ID DEALERSHIP_ID
REGIONAL_MANAGER REGIONAL_MANAGER
DEALERSHIP_MANAGER DEALERSHIP_MANAGER
HIRE_DATE HIRE_DATE
DATE_ENTERED DATE_ENTERED
SQ_employees_layout RE_emp_FORMAT_NAME_GENDER_PHONE
FIRSTNAME in_FIRSTNAME
LASTNAME in_LASTNAME
PHONE_NUMBER in_PHONE_NUMBER
GENDER in_GENDER
AGE AGE
RE_emp_FORMAT_NAME_GENDER_PHONE SC_STG_EMPLOYEES
OUTNAME EMPLOYEE_NAME
OUT_PHONE EMPLOYEE_PHONE_NUMBER
OUT_GENDER_PORT EMPLOYEE_GENDER
OUT_AGE_GROUP AGE_GROUP
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2, Informaticca and/or itss93affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
b) Your mapping should appear similar to the figure below:
Un
nauthorized
94 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 8: Completed Session Task Source Properties:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2, Informaticca and/or itss95affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 9: On-Success Email Value Edit button:
Un
nauthorized
96 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Total Records Loaded = %l
Total Records Rejected = %r
h) Your email text should appear as shown below:
i) Click OK
j) Optional - Configure an On-Failure email.
k) Click OK.
l) Save the workflow.
5) If your session failed or had errors troubleshoot and correct them by reviewing
the session log and make any necessary changes to your mapping or workflow.
6) Check your email
a) If it is not already open, login to Windows Live Mail
b) User name = Studentxx@infa-server.com.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2, Informaticca and/or itss97affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
c) Password = Studentxx
d) Your inbox should show an on-success email as seen below:
Un
nauthorized
98 d reproductio
on or distrib
bution
Labprohib bited. Copyrright© 2012
4.2 – m_STG_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
PowerCenter will define a homogeneous join between the two Oracle source tables.
That source database server will perform an inner join on the tables based on a join
statement automatically generated by the Source Qualifier. The join set will be
loaded into the staging table.
Goals:
Import relational source definitions.
View relationships between relational sources.
Use a Source Qualifier to define a homogeneous join and view the statement.
Duration:
30 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
5.1 –bited. Copyrright© 2012
m_STG_Product_xx 2, Informaticca and/or itss99affiliates.
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Relational Source Definition
1) If you are not already logged into PowerCenter, please double-click the
Figure 1: Source Definitions with a PK/FK Relationship Displayed in the Source Analyzer:
Un
nauthorized
100 d reproductio
on or distrib
butionLab
prohib
5.1 –bited. Copyrright© 2012
m_STG_Product_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 2. Create a Shortcut to the Target Definition
1) Open the Target Designer.
2) Right-click in the workspace and select Clear All.
3) Create a shortcut to STG_PRODUCT. Rename it SC_STG_PRODUCT.
4) Save your work.
8) The Select Sources for Source Qualifier Transformation dialog box will appear
as shown below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
5.1 –bited. Copyrright© 2012
m_STG_Product_xx 2, Informaticca and/or its
s affiliates.
101
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
12) Add SC_STG_PRODUCT target to the mapping.
14) Save your mapping and confirm that it is valid. Note that the PRODUCT_CODE
port in the Source Qualifier is unlinked as intended as it is not needed at the
target.
2) Open the SQL Query Editor by Clicking the arrow in the SQL Query property.
3) Click the Generate SQL button. Note that he join statement can now be
previewed, and that it is an inner join. Also note that the PRODUCT_CODE
column is not in the SELECT Statement; this is because the column is not linked
in the mapping and is not needed.
Un
nauthorized
102 d reproductio
on or distrib
butionLab
prohib
5.1 –bited. Copyrright© 2012
m_STG_Product_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) Your SQL Editor should appear as displayed in the figure below:
a) Click OK twice.
b) Save your work.
Tip: It is generally not a good practice to save the generated SQL unless
there is a need to override it. If you cancel out of the SQL editor, then at
runtime the session will create what is called the ‘default query’. This is
based on the ports and their links in the mapping. If you click OK and leave
the SQL in the editor window, you’ve overridden (hardcoded) the default
query. Anytime you want to link a new port out of the Source Qualifier (or
delete a link), you would have to go in and regenerate the SQL.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
5.1 –bited. Copyrright© 2012
m_STG_Product_xx 2, Informaticca and/or its
s affiliates.
103
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
e) Check the output when to ensure the workflow saved to the repository
successfully.
f) Start the workflow.
g) Review the session properties.
h) Your information should appear as displayed in the figure below.
4) If your session failed or had errors troubleshoot and correct them by reviewing
the session log and make any necessary changes to your mapping or workflow.
Un
nauthorized
104 d reproductio
on or distrib
butionLab
prohib
5.1 –bited. Copyrright© 2012
m_STG_Product_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
PowerCenter will source from a flat file and relational table. A Joiner transformation
is used to create one dataflow that is then written to a relational target. The flat file is
missing one field the staging target table needs; the cost of each product. This values
can be read from the STG_PRODUCT table. Each row from the source file contains
a value named Product. This value has an identical corresponding value in the
STG_PRODUCT table PRODUCT_ID column. Use the Joiner transformation to
join the flat file to the relational table (heterogeneous join) using this relationship and
then write the results to the STG_TRANSACTIONS table.
Goals:
Study the Joiner Transformation and use it to join two data streams from two
different source types.
Determine how to select the Master side of the join.
Specify a join condition.
Learn how to use link conditions in a workflow.
Duration:
30 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2, Informaticca and/or its
s affiliates.
105
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Flat File Source Definition
1) If you are not already logged into PowerCenter, please double-click the
Un
nauthorized
106 d reproductio
on or distrib
bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 1: Normal View of the Heterogeneous Sources, Source Qualifiers and Target:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2, Informaticca and/or its
s affiliates.
107
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
a) Rename it jnr_SALES_TRANSACTION_STG_PRODUCT.
(i) Select the Ports tab
(ii) Set the Master (M) property to STG_PRODUCT ports.
Tip: Which ports should be Master? Use the source that is the smaller, in row
and bytes, if the data is not sorted. If the source data is sorted, use the source
with the fewest number of join column duplicates.
Figure 3: Edit View of the Ports Tab for the Joiner Transformation:
Master Property
Figure 4: Edit View of the Condition Tab for the Joiner Transformation Without a Condition:
Un
nauthorized
108 d reproductio
on or distrib
bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
10) Select the Detail drop down box and set it to PRODUCT. Your condition should
be the same as displayed in the figure below:
Figure 5: Edit View of the Condition Tab for the Joiner Transformation with Completed
Condition:
Tip: The Joiner transformation can support multiple port conditions to create a
join. If you need multiple port conditions, simply click the Add a new condition
button to add the other ports that make up the port condition.
11) Click OK.
12) Save the repository.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2, Informaticca and/or its
s affiliates.
109
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
a) Your mapping should appear similar to the figure displayed below:
3) Verify your mapping is valid in the Output window. If the mapping is not valid,
correct the invalidations that are displayed in the message.
3) Open wf_m_STG_PRODUCT_xx.
a) Edit the workflow. Rename it
wf_m_STG_PRODUCT_TRANSACTIONS_xx.
b) Click OK.
4) Edit s_m_STG_PRODUCT.
a) In the Mapping Tab
b) Select the truncate target table option for SC_STG_PRODUCT.
5) Click on the session task on the Workflow Task toolbar. Click on the Workflow
Designer workspace.
Un
nauthorized
110 d reproductio
on or distrib
bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
6) Select m_STG_TRANSACTIONS_xx mapping to associate with the session.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2, Informaticca and/or its
s affiliates.
111
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
12) The Expression Editor should appear similar to the figure displayed below:
Figure 8: Expression Editor for the Session:
a) Click OK.
Figure 9: wf_m_STG_PRODUCT_TRANSACTIONS_xx:
d) Check the output when to ensure the workflow saved to the repository
successfully.
Un
nauthorized
112 d reproductio
on or distrib
bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 10: Properties for the Completed Session Run
13) If your session failed or had errors troubleshoot and correct them by reviewing
the session log and make any necessary changes to your mapping or workflow.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2, Informaticca and/or its
s affiliates.
113
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 11: Data Preview of the STG_TRANSACTIONS Target Table:
Un
nauthorized
114 d reproductio
on or distrib
bution
Lab prohib bited. Copyrright© 2012
5.2 – m_STG_Transactions_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Duration:
30 minutes
Instructions
WARNING: In this lab, do not save your work. While it is normally best practice to save
your work frequently while working in PowerCenter, in this case you will be making
changes to a Mapping that is already the way you want it. So don’t save your work!
Step 1. Arrange All and Arrange All Iconic
In a complex Mapping, it can be hard to see how the parts relate. How can you make this
better?
1) Begin with the Mapping from Lab 4-1 (m_STG_CUSTOMER_CONTACTS_xx)
open in the PowerCenter Developer application.
2) Right-click anywhere in the workspace and select Arrange All.
3) Observe the results.
Arrange All is a tool for arranging the transformations in a Mapping neatly.
4) Right-click again and select Arrange All Iconic.
Arrange All Iconic enables you to quickly see the relationships between the objects in a
Mapping.
Step 2. Autolink
1) “Arrange All” on the Mapping.
2) Drag the cursor across the links between the Source definition and the Source
Qualifier to select them.
3) Hit the Delete key on your keyboard.
4) Right-click and select Autolink by Name.
5) Position the cursor over the Source, then click and drag to the Source Qualifier.
6) Click the SQ again to return to the normal (arrow) cursor.
Autolinking provides a quick way to connect the output ports in one transformation to the
input ports in another transformation.
Autolink by Name searches for ports with identical names and connects them
Autolink by Position connects the first output port to the first input port, the second
output port to the second input port, etc.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited.
6 Features andCopyr right© 2012
Techniques 2, Informaticca and/or its
s affiliates.
115
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
7) Delete the links again and Autolink the two by Position.
Un
nauthorized
116 d reproductio
on or distrib
butionLabprohibbited.
6 Features andCopyr right© 2012
Techniques 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 5. Moving Ports
Sometimes just rearranging the ports on a transformation will make the Mapping easier to
read.
1) Edit the Filter transformation and select the Ports tab.
2) Click the AGE port and use the “up arrow” ( ) button to move it to the top of
the list of ports.
3) Single-click and hold the number next to the ZIP field. Note the square that
appears in the cursor.
4) Drag ZIP right below AGE.
5) Click Cancel to discard the changes.
Step 6. Another Method of Creating Transformations
Plus, it bypasses the default names PowerCenter gives a transformation.
1) From the menu, select TransformationCreate
2) Select Aggregator from the dropdown box.
3) Name the Aggregator agg_Demo_Create.
4) Click Create.
a) The new transformation appears in the workspace.
5) By the same method, create a Filter named fil_Demo_Create.
6) Click Done.
While we’re at it, how do you remove an unwanted transformation?
7) The Filter you just created is already selected. Hold down the Shift key and click
the Aggregator you created to select it, too.
8) Hit the Delete key on your keyboard.
a) Note that the Designer dialogue tells you which transformations will be
deleted.
b) Click Yes.
Step 7. Reverting to Saved
Sometimes you make a mistake that you can’t easily undo and need to go back to where
you were before. If you haven’t saved, you can do it.
1) In the Repository Navigator, right-click your folder and select Disconnect.
2) When asked whether to save the changes to your folder, click No.
3) Reopen your folder.
4) If necessary, reopen the Mapping.
5) Note that it is back to the way it was before Step 1.
6) Arrange All for the next step.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited.
6 Features andCopyr right© 2012
Techniques 2, Informaticca and/or its
s affiliates.
117
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 8. Scaling
You may not be able to see the whole Mapping in your workspace. But you can.
1) Maximize PowerCenter Developer.
2) How many transformations can you see?
3) In the Standard toolbar at the top of the window, click the Zoom dropbox
( ) and select 60.
4) Can you see more transformations?
Un
nauthorized
118 d reproductio
on or distrib
butionLabprohibbited.
6 Features andCopyr right© 2012
Techniques 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 11. View Object Dependencies
By viewing object dependencies in the Designer, a user can learn which objects may be
affected by making changes to Source or Target definitions, Mappings, Mapplets, or
transformations. Direct and indirect dependencies are shown.
1) In the Repository Navigator, select the flat-file Source definition
CUSTOMER_LAYOUT.
2) Right-click and select Dependencies.
3) Click OK to show all dependencies.
4) You will see the View Dependencies window, which will show every Mapping,
Session, and Workflow that uses or depends upon the CUSTOMER_LAYOUT
Source, as well as those that it uses or depends on.
5) It also shows the Customers flat file definition in Dev_Shared that
CUSTOMER_LAYOUT depends on.
Note: The Save to File button on the View Dependencies window saves the dependency
information as a HTML file (.htm) for later viewing.
6) Experiment by viewing the dependencies of other objects.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited.
6 Features andCopyr right© 2012
Techniques 2, Informaticca and/or its
s affiliates.
119
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Answers
4.5.e. Was there a change made in the Filter? What was it?
Yes, the name and precision of the Customer Number port changed to match the changes in the
Source Qualifier.
4.5.f. Was there a change made in the Target definition? Why or why not?
No, the Source and Target definitions cannot be changed or edited in the Mapping Designer
workspace. They can only in the Source Analyzer and Target Designer workspaces.
Un
nauthorized
120 d reproductio
on or distrib
butionLabprohibbited.
6 Features andCopyr right© 2012
Techniques 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Goals:
Use the Debug toolbar
Use the Debug Wizard
Duration:
35 minutes
Instructions
Step 1. Copy and Inspect the Debug Mapping
1) In the Designer application, make sure you are connected and open to your
assigned Devxx folder.
2) Expand the folder Dev_Shared.
a) Locate and select the Mapping m_STG_DATES_DEBUG.
b) From the menu, select EditCopy.
3) Return to your Devxx folder.
a) Select your Mapping subfolder.
b) From the menu, select EditPaste.
c) In the “Copy Confirmation” dialogue, click Yes.
4) Save the Repository.
Tip: Note that the Mapping validates properly. The validation process ensures that the
Mapping is technically valid, but it cannot test for errors in business logic.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2, Informaticca and/or its
s affiliates.
121
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Tip: Many Mapping errors can be found by carefully inspecting the Mapping, without
using the Debug Wizard. If the error cannot be quickly located in this manner, the
Debug Wizard can help you by showing the actual data passing through the
transformation ports. However, to use the Debug Wizard effectively, you need to
understand the logic of the Mapping.
Step 2. Open the Debug Toolbar and Start the Debug Wizard
1) On the Toolbar, right-click to bring up a list of available toolbars. Select the
“Debugger” toolbar.
Tip: If the Debugger Toolbar is not visible, it is possible that another toolbar has shifted
it off the screen. Rearrange the other toolbars until you can see it.
2) EITHER click the Start Debugger button ( ) OR press F9 to start the Debug
Wizard.
3) The first page of the Debug Wizard is informational. Please read it and press
Next.
Tip: The Debug Wizard requires a valid Mapping and Session to run – it cannot help you
determine why a Mapping is invalid. The Output window of the Designer will show
you the reason(s) why a Mapping is invalid.
Un
nauthorized
122 d reproductio
on or distrib
bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) The Wizard should now look like this:
Figure 3: Debug Session Creation Dialogue
5) The next page of the Wizard allows you to set connection properties, similar to
creating Sessions in the Workflow Manager application.
a) Set the Target Connection Value to STGxx
(i) You will discard the debugger data in a later step, so this value will be
ignored.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2, Informaticca and/or its
s affiliates.
123
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
c) Your Wizard should now look like this:
Figure 4: Debug Session Connections Dialogue
These panels enable you to set which transformations in the Mapping you wish to
monitor in this debugging session, and set Session configuration information, such as
a parameter file or which connections the variables $Source and $Target correspond
to.
Un
nauthorized
124 d reproductio
on or distrib
bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
e) Ensure that Discard target data is checked.
Figure 5: Discard Target Data
f) Click Finish.
Resize the Debugger Target Data Display and Debugger Data Display windows as
needed.
A good guideline is to have them look something like this:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2, Informaticca and/or its
s affiliates.
125
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 3. Locate the Error
1) Your screen should now look like this:
Figure 7: Designer During a Debug Session
Note: The term “instance” here refers to an object in the Mapping. Thus, each
transformation is an “instance.”
Un
nauthorized
126 d reproductio
on or distrib
bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
6) Click the Step to Instance button ( )
a) Note that one more row has been read, and the first row has been “pushed” to
the Expression transformation and the Target table.
7) Click the Step to Instance button several more times (at least 13), watching how
the data flows from the Instance window to the Target Instance window.
Compare the results between the Target instance and Instance windows.
a) What is the nature of the error in the data being written to the table?
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2, Informaticca and/or its
s affiliates.
127
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
(iii) Once you have a modified expression that you want to keep, copy it to
the Windows clipboard.
2) Close the expression evaluator
3) Stop the Debugger by pressing the Stop Debugger button ( ) on the Debugger
toolbar
a) Click Yes to “Shutdown the debugger.”
4) Edit the Expression transformation and put your modified Expression in place by
pasting it into the Expression Editor.
5) Save your work.
6) Restart the Debugger and test to ensure that your fix worked.
Un
nauthorized
128 d reproductio
on or distrib
bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Answers
3.7.a What is the nature of the error in the data being written to the table?
The month and date seem to be reversed. That is, the data comes in as January 1, January 2, etc.,
but is being written as January 1, February 1, etc.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2, Informaticca and/or its
s affiliates.
129
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
130 d reproductio
on or distrib
bution prohib
Lab 7bited. Copyrright© 2012
– The Debugger 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
PowerCenter will use a flat file as a lookup for employee salary data and use that
information to update the target ODS_EMPLOYEE table. The session property,
Treat Source Rows As, will be used to update the entire table. Use an Event Wait,
Timer and Email task to ensure flat file is on the server in time and if not, send email.
Goals:
Utilize lookup to a flat file.
Determine how to use Treat Source Rows As session property.
Use Event Wait, Timer, Control and Email Tasks in a Workflow
Duration:
45 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2, Informaticca and/or its
s affiliates.
131
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Shortcut to a Relational Source Definition
1) If you are not already logged into PowerCenter, please double-click the
Un
nauthorized
132 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 3. Create a mapping
1) Open the Mapping Designer.
2) If a mapping is visible in the workspace, close it by selected menu option
Mappings Close.
3) Create a new mapping named m_ODS_EMPLOYEES_xx.
4) Add the source definition SC_EMPLOYEES to the mapping.
5) Add SC_ODS_EMPLOYEES target to the mapping.
6) Save your work
2) Move your mouse pointer onto the Mapping Designer workspace and single click
your left mouse button. This will create a new Lookup Transformation.
3) The Select Lookup Table for Lookup Transformation dialog box will appear.
a) Select Import Flat File for the location of the Lookup table.
4) Locate the c:\infa_shared\SrcFiles directory and select the file salaries.txt. If the
file is located in a different location, the instructor will specify.
5) The Flat File wizard will appear. Confirm that the Delimited Option button is
selected.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2, Informaticca and/or its
s affiliates.
133
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
6) Select the Import field names from the first line check box. Your wizard should
appear similar to the figure below:
7) Click Next.
8) Confirm that only the Comma check box under Delimiters is selected.
9) Select the No Quotes option button under Text Qualifier.
10) Click Next.
11) Confirm that the field names are displayed under Column Information. These
were imported from the first line.
12) Click Finish.
13) Confirm that your Lookup transformation appears as displayed in the figure
below:
Figure 5: Normal View of the newly created Lookup Transformation:
14) Drag the EMPLOYEE_ID from the SQ_EMPLOYEES source qualifier to the
new Lookup Transformation.
15) Edit the Lookup Transformation.
16) Rename it lkp_SALARIES.
Un
nauthorized
134 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Velocity Best Practice: Velocity naming conventions specify to name Lookup
transformations lkp_LOOKUP_TABLE_NAME.
c) Click Apply.
(i) You should receive a popup message indicating the Lookup condition is
empty. Click the Yes button to continue.
(ii) Select the Condition tab.
(iii) Select the Add a new Condition button.
(iv) Your condition should look similar to the figure below:
d) Click OK.
19) Autolink by name all ports from the SQ_EMPLOYEE source qualifier to the
SC_ODS_EMPLOYEES target.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2, Informaticca and/or its
s affiliates.
135
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 7: Normal View of the m_ODS_EMPLOYEES_xx mapping:
Un
nauthorized
136 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 8: Mapping Tab – lkp_SALARIES Properties:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2, Informaticca and/or its
s affiliates.
137
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
d) Change the Treat Source Rows as property to Update.
e) Your screen should appear as displayed below:
Figure 9: Properties tab of the s_m_ODS_EMPLOYEES_xx session:
f) Click OK.
Un
nauthorized
138 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
a) Review the session properties.
b) Your information should appear as displayed in the figure below.
5) If your session failed or had errors troubleshoot and correct them by reviewing
the session log and make any necessary changes to your mapping or workflow.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2, Informaticca and/or its
s affiliates.
139
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 7. Add Workflow Tasks to check for arrival of Flat File.
It is always a good idea to make sure your sessions are executing as they should
before you add other logic to a workflow. It makes troubleshooting much easier.
Now that we have determined that our session task is executing as expected, we
will add additional workflow tasks to this workflow to ensure that it executes as
expected.
1) Still in the Workflow Manager, select the Event Wait task from the Workflow
Tasks toolbar. The Event Wait task is shown highlighted below:
Un
nauthorized
140 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) Select the Timer task from the Workflow Tasks toolbar. The Timer task is
shown highlighted below:
e) Add a time in which you would like the timer to start. Two minutes from the
time you start the workflow would be best.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2, Informaticca and/or its
s affiliates.
141
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
f) Select the from the start time of this task radio button.
7) Click OK.
11) Select the Email task from the Workflow Tasks toolbar. The Email task is shown
highlighted below:
Un
nauthorized
142 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
d) Email User Name = Studentxx@infa-server.com
e) Email Subject = No Salaries Flat File
f) Email Text = The Salaries Flat File did not show up in time to execute the
ODS_Employees load.
g) Click OK.
a) Click OK.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2, Informaticca and/or its
s affiliates.
143
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
17) Your workflow should look similar to the figure below:
18) Select the Control task from the Workflow Tasks toolbar. The Control task is
shown highlighted below:
Un
nauthorized
144 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
e) Set the Value drop down to Stop Parent.
f) Click OK.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2, Informaticca and/or its
s affiliates.
145
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
3) Ensure that the Email task is selected.
5) Observe the workflow. Note that the event wait and timer tasks are running
Un
nauthorized
146 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.1 – m_ODS_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
PowerCenter will extract the dates from a shared relational table and load them into a
shared relational target. All columns in the source table have matching columns in
the target table. A primary key for the target table will be assigned using the
Sequence Generator.
Goals:
Create Sources and Targets based on shortcuts.
Create a Sequence Generator transformation.
Create unique integer primary key values using the NEXTVAL port.
Duration:
20 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib bited.
8.2 – Copyrright© 2012
m_ODS_Dates_xx 2, Informaticca and/or its
s affiliates.
147
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Shortcut to a Relational Source Definition
1) If you are not already logged into PowerCenter, please double-click the
Un
nauthorized
148 d reproductio
on or distrib
butionLab
prohib
8.2 bited. Copyrright© 2012
– m_ODS_Dates_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 3. Create a mapping
1) Open the Mapping Designer.
2) If a mapping is visible in the workspace, close it by selected menu option
Mappings Close.
3) Create a new mapping named m_ODS_DATES_xx.
4) Add the source definition SC_STG_DATES to the mapping.
5) Add SC_ODS_DATES target to the mapping.
6) Save your work
2) Move your mouse pointer onto the Mapping Designer workspace and single click
your left mouse button. This will create a new Sequence Generator
Transformation.
3) Confirm that your new Sequence Generator transformation appears similar to the
figure below:
Figure 3: Normal View of the newly created Sequence Generator Transformation:
7) Click the OK button to return to the Normal view of the Sequence Generator.
8) Save your work.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib bited.
8.2 – Copyrright© 2012
m_ODS_Dates_xx 2, Informaticca and/or its
s affiliates.
149
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 5. Link the Target Table
1) Link all the ports from the Source Qualifier transformation to the corresponding
columns in the target object utilizing the Autolink by Name feature.
Figure 4: Normal View of the connected ports to the target:
3) Verify the mapping is valid I the Output window. If the mapping is not valid,
correct the invalidations that are displayed in the message.
Un
nauthorized
150 d reproductio
on or distrib
butionLab
prohib
8.2 bited. Copyrright© 2012
– m_ODS_Dates_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
c) Start the workflow.
4) If your session failed or had errors troubleshoot and correct them by reviewing
the session log and make any necessary changes to your mapping or workflow.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib bited.
8.2 – Copyrright© 2012
m_ODS_Dates_xx 2, Informaticca and/or its
s affiliates.
151
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
152 d reproductio
on or distrib
butionLab
prohib
8.2 bited. Copyrright© 2012
– m_ODS_Dates_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The ODS_PROMOTIONS table requires start and expiration date keys. These exist
in the ODS_DATES table that was populated in the previous lab. To obtain these
date keys, which were created by the sequence generator, it will be necessary to
perform a Lookup to the ODS_DATES table in the ODS database. The
ODS_DATES table changes infrequently so it will be loaded into cache in a
persistent state. The lookup cache can be used often by other Mappings that load
ODS tables.
Goals:
Understand how to configure and use a persistent Lookup cache.
Duration:
25 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.3 – m_ODS_Promotions_xx 2, Informaticca and/or its
s affiliates.
153
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Shortcut to a Relational Source Definition
1) If you are not already logged into PowerCenter, please double-click the
Un
nauthorized
154 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.3 – m_ODS_Promotions_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
3) Create a new mapping named m_ODS_PROMOTIONS_xx.
4) Add the source definition SQ_SC_ PROMOTIONS to the mapping.
5) Add SC_ODS_PROMOTIONS target to the mapping.
6) Use Autolink by Name to link SQ_SC_ PROMOTIONS and
SC_ODS_PROMOTIONS.
7) Save your work.
Step 4. Create Lookups for the Start and Expire Date Keys
1) Examine the Figure 2.
Figure 2: m_ODS_PROMOTIONS_xx Mapping:
3) Examine Figure 3.
Figure 3: m_ODS_DATES from the previous lab that populated the ODS_DATES table:
The ODS Dates table was populated by the previous lab, the DATE_KEY was
generated by the seq_ODS_DATES_Date_key Sequence Generator
transformation and DATE_VALUE has a datetype of datetime.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.3 – m_ODS_Promotions_xx 2, Informaticca and/or its
s affiliates.
155
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) To acquire the value for the START_DK in the ODS_PROMOTIONS target
table, you need to perform a Lookup on the ODS_DATES table.
You will base the Lookup Condition on the _________________ port from
SQ_SC_PROMOTIONS Source Qualifier and the _________________ column
in the ODS_DATES Lookup table.
You will base the Lookup Condition on the __________________ port from
SQ_SC_PROMOTIONS Source Qualifier and the ________________ column in
the ODS_DATES Lookup table.
9) Click YES to verify the “Look up Condition is empty”. You will define this
shortly.
10) Now drag and drop the START_DATE port from SQ_SC_PROMOTIONS
Source Qualifier to an empty port in the lkp_START_DATE_KEY
transformation.
Un
nauthorized
156 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.3 – m_ODS_Promotions_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
11) Make START_DATE input only.
12) Rename START_DATE to IN_ START_DATE.
13) Define the Lookup Condition to look like the figure below:
Note: Notice that this transformation has many ports. We could have unchecked
Output column on all ports except for the ones that we need but since this lookup
transformation will be persistent it would have limited its functionality for all
other mappings that might leverage that data.
18) Make the changes necessary to the Lookup to ensure that the EXPIRE_DATE
finds the proper DATE_KEY.
a) Rename it lkp_EXPIRE_DATE_KEY
b) Rename IN_START_DATE to IN_EXPIRE_DATE
c) Verify the Lookup Condition is correct.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.3 – m_ODS_Promotions_xx 2, Informaticca and/or its
s affiliates.
157
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
19) Link the EXPIRE_DATE port from the SQ_SC_PROMOTIONS Source
Qualifier to the IN_EXPIRE_DATE port in the lkp_EXPIRE_DATE_KEY
transformation.
20) Link DATE_KEY port from the lkp_EXPIRE_DATE_KEY transformation to
the EXPIRY_DK port in the SC_ODS_PROMOTIONS target.
21) Save your work.
Un
nauthorized
158 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.3 – m_ODS_Promotions_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
(vi) The Mapping tab should appear similar to the figure below:
(ii) Check the output when to ensure the workflow saved to the repository
successfully.
4) If your session failed or had errors troubleshoot and correct them by reviewing
the session log and make any necessary changes to your mapping or workflow.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohibbited. Copyrright© 2012
8.3 – m_ODS_Promotions_xx 2, Informaticca and/or its
s affiliates.
159
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 6. Review the Data Results
1) Preview the target data from the Designer. Your data should appear as displayed
in the figure below:
Un
nauthorized
160 d reproductio
on or distrib
bution
Labprohibbited. Copyrright© 2012
8.3 – m_ODS_Promotions_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
Rows from the TRANS_EMPLOYEES table need to be loaded into the
DIM_EMPLOYEES table. Before loading the rows, EMPLOYEE_ID needs to be
tested for NULL values. Invalid rows need to be written to an error file. Valid rows
need to be tested to determine if they exist already in the DIM_EMPLOYEES target
table and tagged for either INSERT or UPDATE accordingly. Finally, any rows sent
to the DIM_EMPLOYEE table need to get valid date keys from DIM_DATES.
Goals:
Employ Update Strategy Transformation to tag rows for INSERT or UPDATE.
Utilize the Router Transformation to conditionally route rows to different target
instances.
Use Default values option for NULL data replacement.
Overriding Target writer option.
Duration:
60 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
161
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Copy mapping from a shared area
1) If you are not already logged into PowerCenter, please double-click the
Un
nauthorized
162 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 2. Edit the Expression Transformation
1) Open the mapping m_DIM_EMPLOYEES_xx.
2) Your mapping should appear similar to the figure below.
a) Click the button to validate the default entry and click OK.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
163
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
b) Rename the in_EMPLOYEE_ID to Source_EMPLOYEE_ID
(i) Note: Source_Employee_ID represents the ID that would come from the
Source, Trans_Employees.
(a) The value could come into the lookup as ‘99999’, which would mean
it was null at the source, as determined by our Default Value on the
port in the Expression Transformation. A null coming from the
source has been determined to be an erroneous record.
(b) Source_Employee_ID could contain a not null value, which would
mean it is either an insert or update for the DIM_EmployeeTarget.
Logic written in the Groups Tab of the Router Transformation will
determine which it is.
Un
nauthorized
164 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
8) Change the SQL Statement
a) Edit the SQL written by PowerCenter from:
SELECT DIM_EMPLOYEES.DIM_EMPLOYEE_ID as
DIM_EMPLOYEE_ID FROM DIM_EMPLOYEES
To
SELECT DIM_EMPLOYEES. EMPLOYEE_ID as DIM_EMPLOYEE_ID
FROM DIM_EMPLOYEES
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
165
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
b) In the Groups tab add 3 new groups using the Add new group icon.
(i) Name the first group INSERTS:
(ii) Add the Group filter Condition:
Un
nauthorized
166 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
2) In the Router, scroll down to the INSERTS group and drag all ports, except
DIM_EMPLOYEE_ID1 and HIRE_DATE1, to upd_INSERTS update
strategy.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
167
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
168 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
169
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
170 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
e) Click OK.
2) In the Router, scroll down to the UPDATES Router group and drag all ports,
except Source_EMPLOYEE_ID3 and HIRE_DATE3 to the upd_UPDATES
update strategy transformation.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
171
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
a) Rename the DIM_EMPLOYEE_ID3 port to EMPLOYEE_ID3
b) In the Properties tab, select the Update Strategy Expression value box.
Delete the 0 and enter DD_UPDATE.
5) The Update portion of your mapping should appear similar to the figure below:
Un
nauthorized
172 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
2) Right-click anywhere in the workspace and select Autolink…
c) Select the More>> button and enter a ‘3’ for the From Transformation
Suffix.
3) Click OK.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
173
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
c) Select the More>> button and enter a ‘4’ for From Transformation Suffix.
e) Click OK.
Un
nauthorized
174 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) Arrange all Iconic. Your mapping should appear similar to the figure below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
175
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
176 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
workflow. SQL overrides will override any entries in the mapping until the
override is deleted. Make sure if using ‘shortcuts’ the prefix to the table is
deleted before saving the filter.
1) Select the DIM_EMPLOYEES_ERR target and change the target writer from
Relational to File Writer.
Tip: To create a flat file as a target instead of the original table, simply change
the Writers type from Relational to File. A fixed width flat file based on the
format of the target definition will be created automatically. The properties of
this file can also be altered by the user.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
177
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 9: Properties for the Completed Session Run
2) If your session failed or had errors troubleshoot and correct them by reviewing
the session log and make any necessary changes to your mapping or workflow.
Scroll all the way to the right and confirm that the INSERT_DK column was
updated and not the UPDATE_DK column.
Un
nauthorized
178 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Also, you may want to review the three rows that were written to the error file.
See the instructor for the location of the files. If the server is running on UNIX,
you may need special permission from your administrator to see the files.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2, Informaticca and/or its
s affiliates.
179
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Review the DIM_EMPLOYEES target data from the Designer. Scroll to the far
right of the data screen and notice that there are now entries for UPDATE_DK
and new entries at the bottom of the list for INSERT_DK.
Un
nauthorized
180 d reproductio
on or distrib
butionLabprohibbited. Copyrright© 2012
9 – m_DIM_Employees_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The information needed resides in two separate dimension tables. To compound this,
the relationship between the two tables does not exist on the database. Referential
integrity will have to be created within PowerCenter. Special formulas are needed to
process the discounts out of range. To make this more efficient, the user of mapping
parameters and variables will be used.
Goals:
Employ the use of an Unconnected Lookup to conditionally check rows as they pass
through the mapping.
Utilize the Aggregator Transformation to group and sum values.
Use Mapping Parameters to improve the flexibility of the mapping.
Duration:
35 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2, Informaticca and/or its
s affiliates.
181
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Copy mapping from a shared area
1) If you are not already logged into PowerCenter, please double-click the
10) Open the Source Analyzer workspace and select Clear All.
a) Drag the DIM_TRANSACTIONS and DIM_PAYMENT relational sources
from the EDW node onto the workspace.
Note: Creating the PK-FK relationship within the Source Analyzer does not
create the relationship on the actual physical database. The relationship is
created on the Source Definitions within the PowerCenter Repository only.
Un
nauthorized
182 d reproductio
on or distrib
butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Your source definitions should appear the same as displayed below:
Figure 2: Source Analyzer view of the DIM_PAYMENT and DIM_TRANSACTIONS tables:
b) Click OK.
3) On the Declare Parameters and Variables dialog, click the Add a new variable
to this table icon as shown in the figure below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2, Informaticca and/or its
s affiliates.
183
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
5) Click OK.
6) Save your work.
Un
nauthorized
184 d reproductio
on or distrib
butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
(i) Click on PROMO_ID, then click the Copy icon , and then the Paste
icon .
(ii) Name the new port IN_PROMO_ID and make it an input only port.
(iii) Make DISCOUNT the return port.
(iv) Uncheck the Output ports for all other ports except PROMO_ID and
DISCOUNT.
(v) The lookup should look the same as the figure below:
Figure 3: Lookup Ports tab showing input, output and return ports checked/unchecked:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2, Informaticca and/or its
s affiliates.
185
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) Drag the following ports from the Expression transformation to the Aggregator:
a) PAYMENT_ID
b) CUST_ID
c) DEALERSHIP_ID
d) PROMO_ID
e) SELLING_PRICE
f) UNIT_COST
g) SALES_QTY
h) HOLDBACK
i) REBATE
j) OUT_DISCOUNT
Un
nauthorized
186 d reproductio
on or distrib
butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
5) Your mapping should look similar to the figure below:
6) Open the Aggregator and re-order the key ports in the following order:
a) CUST_ID
b) PRODUCT_KEY
c) DEALERSHIP_ID
d) PAYMENT_ID
e) PROMO_ID
f) DATE_KEY
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2, Informaticca and/or its
s affiliates.
187
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
9) Rename:
a) SELLING_PRICE to IN_SELLING_PRICE
b) UNIT_COST to IN_UNIT_COST
c) SALES_QTY to IN_SALES_QTY
d) OUT_DISCOUNT to DISCOUNT
The Aggregator ports should be the same as displayed in the figure below:
Un
nauthorized
188 d reproductio
on or distrib
butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 4: Finished Aggregator:
11) Use Autolink by name to link the ports from the agg_FACT_SALES
transformation to the FACT_SALES target table. You will need to use the prefix
of OUT_ to link all of the ports.
12) The results should appear the same as the figure below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2, Informaticca and/or its
s affiliates.
189
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
190 d reproductio
on or distrib
butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
7) If your session failed or had errors troubleshoot and correct them by reviewing
the session log and make any necessary changes to your mapping or workflow.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2, Informaticca and/or its
s affiliates.
191
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 8. Review the Data Results
1) Preview the target data from the Designer. Your data should appear as displayed
in the figure below:
Figure 8: Data Preview of the FACT_SALES Target Table:
Un
nauthorized
192 d reproductio
on or distrib
butionLab
prohib
10.1bited. Copyrright© 2012
– m_Fact_Sales_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
To take advantage of previously created objects, we will create a mapplet from
existing objects used in a previous mapping. This mapplet can then be used in other
mappings.
Goals:
Use a mapplet in a mapping
Duration:
10 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
10.2bited. Copyrright© 2012
– m_Fact_Sales_xx 2, Informaticca and/or its
s affiliates.
193
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create the Mapplet
1) In the Mapping Designer, re-open the m_FACT_SALES_xx mapping.
2) Highlight the following five transformations by holding down the Ctrl key and
pressing the left mouse button:
a) lkp_DIM_PROMOTIONS
b) lkp_DIM_PRODUCT
c) lkp_DIM_DATES
d) exp_DISCOUNT_TEST
e) agg_FACT_SALES
5) Your mapplet definition should look the same as the figure below:
Figure 1: Mapplet Designer View of mplt_AGG_SALES:
Un
nauthorized
194 d reproductio
on or distrib
butionLab
prohib
10.2bited. Copyrright© 2012
– m_Fact_Sales_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
8) From the exp_DISCOUNT_TEST transformation, drag all Input ports to the
Mapplet Input transformation
9) From the Aggregator agg_FACT_SALES, drag all Output ports to the Output
transformation.
10) Select the Scale to Fit icon.
13) Notice that the mapplet is invalid. Scroll through the messages in the output
window. They point to the expression exp_DISCOUNT_TEST as having an
invalid symbol reference. The reference to the parameter $$MAX_DISCOUNT
is invalid as it does not exist within the mapplet parameter definition.
Note: Mapping parameters and variables that are created in a mapping are not
available for use in the mapplet that is called from the mapping.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
10.2bited. Copyrright© 2012
– m_Fact_Sales_xx 2, Informaticca and/or its
s affiliates.
195
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
3) Use Autolink by Name to linkt he ports from the
SQ_DIM_TRANSACTIONS_PAYMENT to the mplt_AGG_SALES input.
4) Manually link the DISCOUNT port to the IN_DISCOUNT port.
5) Use Autolink by name to link the Output portion of the mapplet to the target.
You will need to specify ‘OUT_ ‘for the prefix and ‘1’ for the suffix.
6) Save your work
Un
nauthorized
196 d reproductio
on or distrib
butionLab
prohib
10.2bited. Copyrright© 2012
– m_Fact_Sales_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The source for the weekly Product aggregate table will be the daily Product aggregate
table. The mapping to load this table is located in the DEV_SHARED folder. A
workflow needs to be created that will run the weekly aggregate load session after the
daily aggregate load session has run 7 times. This can be accomplished using an
assignment tasks, a decision task, link conditions and session tasks. A load date
equal to the beginning day of the week will be used to provide the date key for the
weekly aggregate table. The mapping to accomplish this has already been created
and will need to be copied from the DEV_SHARED folder. It contains a mapping
variable that will be incremented by 1 at the end of the session/mapping run.
Goals:
Assign Workflow Variables
Increment Workflow Variables using the Assignment Task
Branch the logic of a workflow using a Decision Task
Use Link Conditions
Duration:
35 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 11 –prohibbited. Copyrright© 2012
wf_Fact_Product_Agg_Weekly_xx 2, Informaticca and/or its
s affiliates.
197
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Copy the mappings
1) In the Mapping Designer, copy:
a) m_FACT_PRODUCT_AGG_DAILY_xx mapping
b) m_FACT_PRODUCT_AGG_WEEKLY_xx mapping
from the DEV_SHARED folder.
Un
nauthorized
198 d reproductio
on or distrib
bution
Lab 11 –prohibbited. Copyrright© 2012
wf_Fact_Product_Agg_Weekly_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
c) In the Variables tab create a new workflow variable
(i) Variable Name = $$WORKFLOW_RUNS
(ii) Datatype = integer
(iii) Persistent = checked
(iv) Default Value = 0
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 11 –prohibbited. Copyrright© 2012
wf_Fact_Product_Agg_Weekly_xx 2, Informaticca and/or its
s affiliates.
199
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
b) In the Expression tab, create an expression that increments the User Defined
Variable named $$WORKFLOW_RUNS by 1. See the figure below for
details.
Tip: The decision task will evaluate the expression and return a value of
TRUE or FALSE. This can be checked in a link condition to determine
the direction taken.
Un
nauthorized
200 d reproductio
on or distrib
bution
Lab 11 –prohibbited. Copyrright© 2012
wf_Fact_Product_Agg_Weekly_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 5. Create the Session Task
1) Create a session task named s_m_FACT_PRODUCT_AGG_WEEKLY_xx
associated with the m_FACT_PRODUCT_AGG_WEEKLY_xx mapping.
2) Link the dcn_RUN_WEEKLY decision task to the
s_m_FACT_PRODUCT_AGG_WEEKLY_xx session task.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 11 –prohibbited. Copyrright© 2012
wf_Fact_Product_Agg_Weekly_xx 2, Informaticca and/or its
s affiliates.
201
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
a) Add a link condition that checks to see if the dcn_RUN_WEEKLY decision
task has returned a value of FALSE, meaning that the daily load has
completed and that it is NOT time to load the weekly aggregate table.
Un
nauthorized
202 d reproductio
on or distrib
bution
Lab 11 –prohibbited. Copyrright© 2012
wf_Fact_Product_Agg_Weekly_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
a) Start the workflow
b) Review the workflow in the Gantt view of the Workflow Monitor. It should
appear similar to the figure below:
Note: Each time you execute the workflow, this value will increment by one.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 11 –prohibbited. Copyrright© 2012
wf_Fact_Product_Agg_Weekly_xx 2, Informaticca and/or its
s affiliates.
203
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 10: Value of the $$WORKFLOW_RUNS variable after the first run:
5) Run the workflow six more times to emulate a week’s normal runs and after the
last run the Task View should be similar to the figure below:
Figure 11: Task View of the Completed Workflow run after the weekly load runs.
Un
nauthorized
204 d reproductio
on or distrib
bution
Lab 11 –prohibbited. Copyrright© 2012
wf_Fact_Product_Agg_Weekly_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
In this exercise, you will move expression transformation logic into a session-level
parameter file in order to increase the flexibility of the mapping. This mapping will
handle changing expressions by using the IsExprVar property. Variables will be used
in the session as well to parameterize the source files and database connection.
Students will copy the mapping from DEV_SHARED, then add mapping variables as
well as edit the expression transformation to point gender, phone formatting and age
range to those variables. A session parameter file will be created to calculate these
expressions.
Goals:
Ascertain the use of the IsExprVar property in a mapping.
Determine the structure of a parameter file.
Establish the use of parameter files in mappings and sessions
Prove the flexibility of using parameter files to build mapping expression logic.
Duration:
45 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
205
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Copy the mappings
1) Copy the m_STG_EMPLOYEES_Parm_xx mapping from the DEV_SHARED
folder.
2) Select Yes for any Target Dependencies.
3) Select Reuse to resolve any conflicts.
4) Rename the mappings to include your student number.
5) Save your work.
Figure 1: m_STG_EMPLOYEES_Parm_xx
2) Now you will create the mapping variables to store the logic of the previous
ports.
Un
nauthorized
206 d reproductio
on or distrib
bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
5) Add a Variable called $$PHONE.
a) Datatype = string
b) Precision = 600
c) Aggregation = Max
d) IsExprVar = True
9) Click OK.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
207
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 3: Notepad file with logic from the four ports of the exp_FORMAT_Name_Gender_Phone
expression:
Un
nauthorized
208 d reproductio
on or distrib
bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 4. Create a Parameter File
1) Navigate to C:\infa_shared\ParmFiles\.
5) Change ‘xx’ within the file to reflect your student number in the references to the
folder names, workflow names and session names.
Note: Devxx reflects the folder name as stated in the lecture. It is important that the
folder name be changed to reflect your folder in the repository (i.e. the one you have
been using in the PowerCenter Designer and Workflow Manager.
(i) $PMWorkflowLogFile=$PMRootDir\WorkflowLogs\wf_m_EMPLO
YEES_Parm_xx.log.bin
7) According to the requirements, you will now parameterize the target database
connection
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
209
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
a) Under the entry for the session, add the entry to parameterize the target
database connection. That entry appears below:
b) Maximize the untitled notepad file. Copy and paste the logic for each port
after each appropriate parameter.
Note: it is important not to add any carriage returns within the variable port
logic for each parameter.
10) When you are finished, your parameter file should appear similar to the figure
below:
Un
nauthorized
210 d reproductio
on or distrib
bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
a) On the Properties tab
(i) Modify the Parameter Filename Attribute to point to the newly created
parameter file.
(ii) Change the Workflow Log File Name Attribute to point to the newly
created Workflow Log Name parameter.
(iii) Your Workflow Properties should appear similar to the figure below:
Figure 6: Workflow Properties for wf_m_EMPLOYEES_Parm_xx:
b) Click OK.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
211
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
212 d reproductio
on or distrib
bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
d) When you are finished, your Target Properties should appear similar to the
figure below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
213
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
6) Click OK.
7) Save your work.
a) Note the Override values that were used for the session.
Un
nauthorized
214 d reproductio
on or distrib
bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
215
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
216 d reproductio
on or distrib
bution prohib
Lab 12.1 bited. Copyrright© 2012
– m_STG_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
Make the DIM_EMPLOYEES load more flexible by adding mapping, session and
workflow variables. The mapping will use a $$DATE_ENTERED variable to
increment the daily load in a source qualifier override. This variable will be defined
in the parameter file. The session associated with this mapping will be added
previously created workflow in order to execute both the staging and dimension loads
for the Employees within one workflow.
Goals:
Ascertain the use of the IsExprVar property in a mapping.
Determine the structure of a parameter file.
Establish the use of parameter files in mappings and sessions
Prove the flexibility of using parameter files to build mapping expression logic.
Duration:
45 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.2 bited. Copyrright© 2012
– m_DIM_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
217
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Copy the mappings
1) Copy the m_DIM_EMPLOYEES_Parm_xx mapping from the DEV_SHARED
folder.
2) Select Yes for any Target Dependencies.
3) Select Reuse to resolve any conflicts.
4) Rename the mappings to include your student number.
5) Save your work.
Figure 1: m_DIM_EMPLOYEES_Parm_xx
3) Mappings Parameters and Variables from the menu and create a mapping
variable $$DATE_ENTERED to store the value of
STG_EMPLOYEES.DATE_ENTERED.
Un
nauthorized
218 d reproductio
on or distrib
bution prohib
Lab 12.2 bited. Copyrright© 2012
– m_DIM_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
This is the date that will be used to incrementally load the DIM_EMPLOYEES
table.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.2 bited. Copyrright© 2012
– m_DIM_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
219
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 3. Edit the Parameter File
1) Open the C:\infa_shared\ParmFiles\Employees_Parm_xx.txt file.
Un
nauthorized
220 d reproductio
on or distrib
bution prohib
Lab 12.2 bited. Copyrright© 2012
– m_DIM_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
3) Add another session to the workflow. The session should be associated with
m_DIM_EMPLOYEES_Parm_xx mapping and should be named
s_m_DIM_EMPLOYEES_Parm_xx.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.2 bited. Copyrright© 2012
– m_DIM_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
221
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 4: Connections for s_m_DIM_EMPLOYEES_Parm_xx:
a) Ensure that the Source Filter appears the same as the figure below:
Un
nauthorized
222 d reproductio
on or distrib
bution prohib
Lab 12.2 bited. Copyrright© 2012
– m_DIM_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 5: Source Filter for SQ_STG_EMPLOYEES:
b) Click OK.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 12.2 bited. Copyrright© 2012
– m_DIM_Employees_Parm_xx 2, Informaticca and/or its
s affiliates.
223
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 6: Properties for the Completed Session Run
Un
nauthorized
224 d reproductio
on or distrib
bution prohib
Lab 12.2 bited. Copyrright© 2012
– m_DIM_Employees_Parm_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
PowerCenter will source from the table CUSTOMERS and load the dimension table
DIM_CUSTOMERS. Customer data may have more than one occurrence in the
source. Data will have to be tested for new rows, existing rows and invalid rows. A
Dynamic Lookup will need to be used since a customer row could occur more than
once at the source. Some rows will have null data so flat file error logging will be
used to capture these.
Goals:
Introduce Dynamic Lookups.
Reinforce the use of Update Strategies.
Introduce Error Logging.
Duration:
50 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2, Informaticca and/or its
s affiliates.
225
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Source Definition Shortcut
1) Launch the Designer and login to your assigned folder.
2) Open the Source Analyzer workspace and select Clear All.
(i) Create a shortcut to the SDBU.CUSTOMERS source table found in the
DEV_SHARED folder.
(ii) Rename it SC_CUSTOMERS.
3) Confirm that your source definition appears the same as displayed in the figure
below:
Figure 1: Source Definition – SC_CUSTOMERS:
2) Confirm that your target definition appears the same as displayed in the figure
below:
Un
nauthorized
226 d reproductio
on or distrib
bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 3. Create a Mapping
1) Open the Mapping Designer.
2) Create a new mapping named m_DIM_CUSTOMERS_xx
3) Add the SC_CUSTOMERS source definition.
4) Add the SC_DIM_CUSTOMERS target definition.
5) Save your work.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2, Informaticca and/or its
s affiliates.
227
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
c) Select the Ports tab
(i) For all ports from the SQ_SC_CUSTOMERS prefix them with IN_ and
remove the ‘1’ form the end of the name as shown in the figure below:
e) Select the Ports tab again; It should look the same as the figure below.
Notice the new port entry called NewLookupRow.
Un
nauthorized
228 d reproductio
on or distrib
bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 5: Port Tab view of a Dynamic Lookup:
Note: Dynamic lookups allow for inserts and updates to take place in cache as
the same operations take place against the target table.
Note: The Associated port column is there to allow the association of input ports
with lookup ports of different names. This enables PowerCenter to update the
Lookup Cache will correct values.
f) Under the Associated Port column, click the box where it says “N/A” and
select the port names from the list that you want to associate. See the figure
below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2, Informaticca and/or its
s affiliates.
229
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
g) Associate the remaining ports.
h) Clear the Output checkmarks for all of the ports prefixed with “IN_”.
3) Create a condition that allows all rows that are marked for update or insert, or all
rows where the CUST_ID is NULL to pass through. Any rows where
NewLookupRow != 0 are deemed to be inserts or updates. If you need any
assistance refer to the reference section at the end of the lab.
Un
nauthorized
230 d reproductio
on or distrib
bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 8: M_DIM_CUSTOMERS mapping with Filter:
2) Drag all ports from the Filter transformation to the Update Strategy
transformation.
b) Ensure the Forward Rejected Rows option is checked. This will send any
rejected rows to error logs which will be created later.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2, Informaticca and/or its
s affiliates.
231
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 7. Create and Execute the Workflow
1) Launch the Workflow Manager and sign into your assigned folder.
2) Create a new workflow named wf_DIM_CUSTOMERS_xx.
5) Review the session properties, your information should appear similar to the
figure below:
Un
nauthorized
232 d reproductio
on or distrib
bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 11: Properties of the Completed Session Run:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2, Informaticca and/or its
s affiliates.
233
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 9. Error Log Results
1) The error log is written to the BadFiles directory on the PowerCenter Server
under the default name of PMErrorxx.log. Look in this location for the error log
and look at the rows that were written there. The log should appear similar to the
figure below:
Reference
2) Fil_ROWS_UNCHANGED Condition
a) NewLookupRow != 0 or ISNULL(CUST_ID)
3) Upd_DIM_CUSTOMERS Expression
a) IIF(ISNULL(CUST_ID), DD_REJECT, IIF(NewLookupRow = 1,
DD_INSERT, IIF(NewLookupRow = 2, DD_UPDATE)))
Un
nauthorized
234 d reproductio
on or distrib
bution
Labprohib
13.1 – bited. Copyrright© 2012
m_DIM_Customers_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
We will route the Fatal Errors off to a Fatal Error table and route the Nonfatal
Errors off to a Nonfatal table. All “good” data will be sent to the EDW. This will
be achieved by creating a flag for both fatal and nonfatal errors. Route bad data to its
respective physical database table.
Goals:
Trap all database errors and load them to a table called ERR_FATAL.
Trap the “dirty data” coming through from the CATEGORY field and write it to a
table called ERR_NONFATAL.
Write all data without fatal or nonfatal errors to DIM_VENDOR_PRODUCT.
Duration:
60 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2, Informaticca and/or its
s affiliates.
235
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Source Definition Shortcut
1) Launch the Designer and login to your assigned folder.
2) Open the Source Analyzer workspace and select Clear All.
(i) Create a shortcut to the PRODUCT source flat file found in the
DEV_SHARED folder.
(ii) Rename it SC_PRODUCT.
New output ports need to be created to test for erroneous records. Your current
business requirements state that you need to check for null PRODUCT_CODE
and null CATEGORY. If more error requirements are gathered later, you can
add that logic to this expression. You will also need to create a port that will
capture the error record. All columns from the error record will need to be
concatenated into this port.
Un
nauthorized
236 d reproductio
on or distrib
bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
3) Click on the ports tab and create 3 new output ports.
a) Output port #1
(i) Name = out_INVALID_PRODUCT_CODE
(ii) Datatype = string
(iii) Precision = 10
(iv) Expression = IIF(ISNULL(PRODUCT_CODE),'FATAL','GOOD
DATA')
(v)
b) Output port #2
(i) Name = out_INVALID_CATEGORY
(ii) Datatype = string
(iii) Precision = 10
(iv) Expression = IIF(ISNULL(CATEGORY), 'NONFATAL', 'GOOD
DATA')
c) Output port #3
(i) Name = out_ERR_RECORD
(ii) Datatype = string
(iii) Precision = 500
(i) Expression = TO_CHAR(PRODUCT_CODE) || '|' || CATEGORY || '|'
||TO_CHAR(VENDOR_ID) || '|' || PRODUCT_NAME || '|' || MODEL || '|'
|| TO_CHAR(PRICE) || '|' || TO_CHAR(COST) || '|' ||
TO_CHAR(DISCONTINUED_FLAG) || '|' || DATA_PULL_DATE || '|' ||
TO_CHAR(REC_NUM)
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2, Informaticca and/or its
s affiliates.
237
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 5. Create a Lookup Transformation
1) Create a new Lookup transformation using the ODS_VENDOR table.
Un
nauthorized
238 d reproductio
on or distrib
bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 6. Create a Router Transformation
1) Create a Router transformation named rtr_PRODUCT_DATA.
4) Create groups
a) Group #1 = NONFATAL_ERRORS
(i) out_INVALID_CATEGORY='NONFATAL'
b) Group #2 = FATAL_ERRORS
(i) Out_INVALID_PRODUCT_CODE='FATAL'
The default group will contain rows that do not match the above
conditions, hence all good rows.
Your router Groups tab should appear similar to the figure below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2, Informaticca and/or its
s affiliates.
239
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
5) Your mapping should appear similar to the figure below:
Figure 3: exp_ERR_TRAPPING, lkp_ODS_VENDOR, rtr_PRODUCT_DATA:
b) Output Port #2
(i) Name = out_LOAD_DATE
(ii) Datatype = DateTime
(iii) Expression = SESSSTARTTIME
Un
nauthorized
240 d reproductio
on or distrib
bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 8. Create a Sequence Generator
1) Create a Sequence Generator named seq_NONFATAL
2) Link the NEXTVAL port of the sequence generator to the ERR_ID port of
SC_ERR_NONFATAL target.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2, Informaticca and/or its
s affiliates.
241
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
3) Create output ports
a) Output Port #1
(i) Name = out_ERR_DESCRIPTION
(ii) Datatype = String
(iii) Precision = 20
(iv) Expression = ‘'NULL VALUE IN KEY'’
b) Output Port #2
(i) Name = out_LOAD_DATE
(ii) Datatype = DateTime
(iii) Expression = SESSSTARTTIME
Un
nauthorized
242 d reproductio
on or distrib
bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
3) Your mapping should appear similar to the figure below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2, Informaticca and/or its
s affiliates.
243
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
4) Right Click and Arrange All Iconic
5) Review the session properties, your information should appear similar to the
figure below:
Un
nauthorized
244 d reproductio
on or distrib
bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Figure 5: Properties of the Completed Session Run:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2, Informaticca and/or its
s affiliates.
245
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
246 d reproductio
on or distrib
bution prohib
Lab 13.2 bited. Copyrright© 2012
– m_DIM_Vendor_Product_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
A multiple row return lookup will be used in conjunction with an aggregator to
achieve this calculation.
Goals:
Exam and use Informatica v9 multiple row return lookups.
Duration:
30 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 14prohib
bited. Copyrright© 2012
– m_ODS_Customer_Billing_xx 2, Informaticca and/or its
s affiliates.
247
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Create a Source Definition Shortcut
1) Launch the Designer and login to your assigned folder.
2) Open the Source Analyzer workspace and select Clear All.
(i) Create a shortcut to the ODS_CUSTOMERS relational table found in the
DEV_SHARED folder.
(ii) Rename it SC_ODS_CUSTOMERS.
2) On the Select Lookup Table for Lookup Transformation dialog box, Select the
Return All Values on Multiple Match checkbox.
Un
nauthorized
248 d reproductio
on or distrib
bution
Lab 14prohibbited. Copyrright© 2012
– m_ODS_Customer_Billing_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
3) Import the lookup table from SDBU.CUSTOMER_ORDERS.
4) Select all of the output ports from SQ_SC_ODS_CUSTOMERS and copy them
to an empty port on the lookup.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 14prohib
bited. Copyrright© 2012
– m_ODS_Customer_Billing_xx 2, Informaticca and/or its
s affiliates.
249
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
9) Click OK.
10) Save your work.
3) Group by CUST_ID.
Un
nauthorized
250 d reproductio
on or distrib
bution
Lab 14prohibbited. Copyrright© 2012
– m_ODS_Customer_Billing_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
c) Output Port #3
(i) Name = COUNT_CUSTOMER_ORDERS
(ii) Datatype = Decimal
(iii) Precision = 10
(iv) Expression = COUNT(ORDER_NO)
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 14prohib
bited. Copyrright© 2012
– m_ODS_Customer_Billing_xx 2, Informaticca and/or its
s affiliates.
251
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 6. Create and Execute the Workflow
1) Launch the Workflow Manager and sign into your assigned folder.
2) Create a new workflow named wf_m_ODS_CUSTOMER_BILLING_xx.
5) Review the session properties, your information should appear similar to the
figure below:
Un
nauthorized
252 d reproductio
on or distrib
bution
Lab 14prohibbited. Copyrright© 2012
– m_ODS_Customer_Billing_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Step 7. Review Data Results
1) Preview the target data from the Designer. Your data should appear as displayed
in the figure below:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 14prohib
bited. Copyrright© 2012
– m_ODS_Customer_Billing_xx 2, Informaticca and/or its
s affiliates.
253
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
254 d reproductio
on or distrib
bution
Lab 14prohibbited. Copyrright© 2012
– m_ODS_Customer_Billing_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The instructions will provide enough detail for you to design and build the mapping
necessary to load the promotions aggregate table. It is suggested that you use the
Velocity best practices that have been discussed during the course. The workshop
will provide mapping specification documents that can be to design the mapping. If
you are unclear on any instructions, please ask the instructor.
Goals:
Design and create a mapping to load an aggregate table.
Duration:
120 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
bited. Copyrright© 2012
Lab 15 – m_FACT_Promotions_Agg_Daily_xx 2, Informaticca and/or its
s affiliates.
255
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Velocity Deliverable: Mapping Specifications
Mapping Name:
Source System(s):
Target System(s):
Short Description:
Load Frequency:
Preprocessing:
Post Processing:
Error Strategy:
Reload Strategy:
Unique Source
Fields (PK):
Dependant
Objects
SOURCES
Tables
Table Name System/Schema/Owner Selection/Filter
Files
File Name File Location Fixed/Delimited Additional File
Info
Un
nauthorized
256 d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
Lab 15 – m_FACT_Promotions_Agg_Daily_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
TARGETS
Files
File Name File Location Fixed/Delimited Additional File Info
LOOKUPS
Lookup Name
Table Location
Match Condition(s)
Persistent / Dynamic
Filter/SQL Override
Source Target
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
bited. Copyrright© 2012
Lab 15 – m_FACT_Promotions_Agg_Daily_xx 2, Informaticca and/or its
s affiliates.
257
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
SOURCE TO TARGET FIELD MATRIX
Defaul
Target Source t Data
System/ Target Data System/ Source Data Value Issues/
Table Column type Table Column type Expression if Null Quality
Un
nauthorized
258 d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
Lab 15 – m_FACT_Promotions_Agg_Daily_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Workshop Details
1) Sources and Targets
a) Source: TRANSACTIONS
b) This relational table contains sales transactions for 7 days. It exists in the
SDBU schema and contains 5,475 records. For the purpose of this mapping,
we will read all 7 days of data. See the figure below for the source table
layout.
c) Target: FACT_PROMOTIONS_AGG_DAILY
(i) This relational is located in the EDWxx schema. After executing the
mapping, it should contain 1,073 records. See the figure below for the
target table layout:
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
bited. Copyrright© 2012
Lab 15 – m_FACT_Promotions_Agg_Daily_xx 2, Informaticca and/or its
s affiliates.
259
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
260 d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
Lab 15 – m_FACT_Promotions_Agg_Daily_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution prohib
bited. Copyrright© 2012
Lab 15 – m_FACT_Promotions_Agg_Daily_xx 2, Informaticca and/or its
s affiliates.
261
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
262 d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
Lab 15 – m_FACT_Promotions_Agg_Daily_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
Name your workflow wf_FileWatcher_xx.
To implement this scenario, you will have to create a workflow with two branches.
The primary branch of the workflow includes the file watcher Event-Wait task. The
Event Wait task will be triggered by the file-watch event (appearance of the indicator
file). If the indicator file appears, the workflow should load the STG_EMPLOYEE
table. After loading the table, an Email should be sent that states the table was
loaded.
The secondary branch completes execution if the indicator file does not appear within
a specified time window. It begins with an Assignment task that assigns a time five
minutes later than when the indicator file is scheduled to appear. After the
Assignment task is a Timer task. The Timer waits for the time set in the Assignment
task. When the time expires, an email should be sent that states that the table was
NOT loaded.
In order to control the workflow branches, each will end in a Command Task. At the
end of the primary branch (after the “success” email task), the command task should
stop the Timer task, then stop the Workflow.
At the end of the secondary workflow branch (after the “not loaded” email task), the
Command task should stop the workflow.
The secondary branch of the workflow should wait for five minutes for the indicator
file to appear before sending the “not loaded” email and stopping the workflow.
In a real-life situation, the Assignment task would add five minutes to the time on the
clock (e.g. 2:00AM plus five minutes) when the file was to have appeared. In this
lab, please add five minutes to the built-in SYSDATE variable.
Please remember that the Integration Service will be looking for the indicator file
relative to the machine upon which it executes – the Informatica server in this case.
Therefore, you will have to place your indicator file upon the infa-server machine.
You already have a mapped drive to that machine. Please place your indicator file on
the mapped drive. Set the location of the file in the EventWait task to
“C:\infa_shared\StudentxxIndcatorFile.txt” where xx is your student ID. You may
want to use an editor such as Notepad to save the file to that location on demand as
you test your workflow.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
16 –bited. Copyrright© 2012
wf_FileWatcher_xx 2, Informaticca and/or its
s affiliates.
263
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Goals:
Design and create a process to complete a workflow and send an email notification if
a specified event does not occur in a given period of time. A workflow that uses an
Event-Wait task to wait for a predefined or user-defined event, such as a file-watch
event, may cause the Integration Service to wait indefinitely until that event has
occurred. A workaround is required.
Duration:
60 minutes
Un
nauthorized
264 d reproductio
on or distrib
butionLab
prohib
16 –bited. Copyrright© 2012
wf_FileWatcher_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Velocity Deliverable: Mapping Specifications
Mapping Name:
Source System(s):
Target System(s):
Short Description:
Load Frequency:
Preprocessing:
Post Processing:
Error Strategy:
Reload Strategy:
Unique Source
Fields (PK):
Dependant
Objects
SOURCES
Tables
Table Name System/Schema/Owner Selection/Filter
Files
File Name File Location Fixed/Delimited Additional File
Info
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
16 –bited. Copyrright© 2012
wf_FileWatcher_xx 2, Informaticca and/or its
s affiliates.
265
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
TARGETS
Files
File Name File Location Fixed/Delimited Additional File Info
LOOKUPS
Lookup Name
Table Location
Match Condition(s)
Persistent / Dynamic
Filter/SQL Override
Source Target
Un
nauthorized
266 d reproductio
on or distrib
butionLab
prohib
16 –bited. Copyrright© 2012
wf_FileWatcher_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Defaul
Target Source t Data
System/ Target Data System/ Source Data Value Issues/
Table Column type Table Column type Expression if Null Quality
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
16 –bited. Copyrright© 2012
wf_FileWatcher_xx 2, Informaticca and/or its
s affiliates.
267
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Workshop Details
1) Create a workflow variable
a) Create a datetime workflow variable named $$WAITTIME.
2) Workflow Tasks
a) The primary branch contains the following tasks:
(i) EventWait – Contains the path to the indicator file.
(ii) Session Task – That loads the STG_EMPLOYEE table.
(iii) Email Task 1 – Success email that states that the STG_EMPLOYEE
table has been loaded. Have the email sent to your student ID (e.g.
Studentxx@infa-server.com). Make sure you have Windows Live Mail
up and running as you test the Workflow.
(iv) Command Task 1 First command: Stops the Timer Task in the secondary
branch when the session completes. Then it stops the workflow. Use the
following PMCMD stoptask command to stop the Timer Task:
C:\Informatica\9.1.0\server\bin\pmcmd stoptask
-sv IS_EDW_Dev
-d Domain_infa-server
-u Administrator
-p admin
-f Devxx
-w YourWorkflowName Timer
Where YourWorkflowName is your workflow name and xx is you student
ID.
(v) CommandTask1 Second command: Stops the workflow so that the
failure email does not execute.
C:\Informatica\9.1.0\server\bin\pmcmd stopworkflow
-sv IS_EDW_Dev
-d Domain_infa-server
-u Administrator
-p admin
-f Devxx YourWorkflowName
Un
nauthorized
268 d reproductio
on or distrib
butionLab
prohib
16 –bited. Copyrright© 2012
wf_FileWatcher_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
(i) Assignment Task – Assigns a value to the $$WAITTIME datetime
variable.
Hint: Use the ADD_TO_DATE function to add five minutes to the built-
in SYSDATE variable.
(ii) Timer Task – Waits until the time set by the $$WAITTIME variable.
(iii) Failure Email task – sends out an email indicating that the file did not
appear.
(iv) Command Task 2 – Stops the workflow because the indicator has not
appeared in the specified time using the command in 2.a.(v) above.
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer butionLab
prohib
16 –bited. Copyrright© 2012
wf_FileWatcher_xx 2, Informaticca and/or its
s affiliates.
269
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Un
nauthorized
270 d reproductio
on or distrib
butionLab
prohib
16 –bited. Copyrright© 2012
wf_FileWatcher_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Technical Description:
The instructions will provide enough detail for you to design and build the workflow
necessary to load all staging table in a single run. It is suggested that you use the
Velocity best practices that have been discussed during the course. If you are unclear
on any instructions, please ask the instructor.
Goals:
Design and create a workflow to load all of the staging tables.
Duration:
60 minutes
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 17 –prohibbited. Copyrright© 2012
wf_Load_All_Staging_Tables_xx 2, Informaticca and/or its
s affiliates.
271
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Velocity Deliverable: Mapping Specifications
Mapping Name:
Source System(s):
Target System(s):
Short Description:
Load Frequency:
Preprocessing:
Post Processing:
Error Strategy:
Reload Strategy:
Unique Source
Fields (PK):
Dependant
Objects
SOURCES
Tables
Table Name System/Schema/Owner Selection/Filter
Files
File Name File Location Fixed/Delimited Additional File
Info
Un
nauthorized
272 d reproductio
on or distrib
bution
Lab 17 –prohibbited. Copyrright© 2012
wf_Load_All_Staging_Tables_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
TARGETS
Files
File Name File Location Fixed/Delimited Additional File Info
LOOKUPS
Lookup Name
Table Location
Match Condition(s)
Persistent / Dynamic
Filter/SQL Override
Source Target
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 17 –prohibbited. Copyrright© 2012
wf_Load_All_Staging_Tables_xx 2, Informaticca and/or its
s affiliates.
273
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
SOURCE TO TARGET FIELD MATRIX
Defaul
Target Source t Data
System/ Target Data System/ Source Data Value Issues/
Table Column type Table Column type Expression if Null Quality
Un
nauthorized
274 d reproductio
on or distrib
bution
Lab 17 –prohibbited. Copyrright© 2012
wf_Load_All_Staging_Tables_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
Instructions
Step 1. Workshop Details
1) Mapping Required
a) This section contains a list of the mappings that will be used in the workflow
(i) m_STG_PAYMENT_xx
(ii) m_STG_PRODUCT_xx
(iii) m_STG_DEALERSHIP _xx
(iv) m_STG_CUSTOMER_CONTACTS_xx
(v) m_STG_TRANSACTIONS_xx
(vi) m_STG_EMPLOYEES_xx
Un
nauthorized
d reproductio
PowerCenter 9x Level on or distrib
I Developer bution
Lab 17 –prohibbited. Copyrright© 2012
wf_Load_All_Staging_Tables_xx 2, Informaticca and/or its
s affiliates.
275
Un
nauthorized
d reproductio
on or distrib
bution prohib
bited. Copyrright© 2012
2, Informaticca and/or itss affiliates.
j) The management only wants the workflow to run a maximum of 50 minutes.
Should the workflow take longer, an email should be sent to the
administrator. Should the workflow finish in the allotted time, the timer task
will need to be stopped.
2) There is more than one solution to the workshop. You will know that your
solution has worked when all of the sessions have completed successfully.
Un
nauthorized
276 d reproductio
on or distrib
bution
Lab 17 –prohibbited. Copyrright© 2012
wf_Load_All_Staging_Tables_xx 2,PowerCenter
Informatic9xca and/or
Level itss affiliates.
I Developer