Using The Debugger
Using The Debugger
By PenchalaRaju.Yanamala
You can debug a valid mapping to gain troubleshooting information about data
and error conditions. To debug a mapping, you configure and run the Debugger
from within the Mapping Designer. The Debugger uses a session to run the
mapping on the Integration Service. When you run the Debugger, it pauses at
breakpoints and you can view and edit transformation output data.
Before you run a session. After you save a mapping, you can run some initial
tests with a debug session before you create and configure a session in the
Workflow Manager.
After you run a session. If a session fails or if you receive unexpected results
in the target, you can run the Debugger against the session. You might also
want to run the Debugger against a session if you want to debug the mapping
using the configured session properties.
You can select three different debugger session types when you configure the
Debugger. The Debugger runs a workflow for each session type. You can
choose from the following Debugger session types when you configure the
Debugger:
Before you run the Debugger, use the Breakpoint Editor in the Mapping Designer
to create breakpoint conditions in a mapping. You can create data or error
breakpoints for transformations or for global conditions. When you run the
Debugger, the Integration Service pauses the Debugger when a breakpoint
evaluates to true. You can review and modify transformation data, and then
continue the session.
Note: You cannot create breakpoints for mapplet Input and Output
transformations.
After you set the instance name, breakpoint type, and optional data condition,
you can view each parameter in the Breakpoints section of the Breakpoint Editor:
When you select the instance name, you can create a breakpoint for an
individual transformation, or you can create a global breakpoint:
When you create an error breakpoint, the Debugger pauses when the Integration
Service encounters error conditions such as a transformation error or calls to the
ERROR function.
You also set the number of errors to skip for each breakpoint before the
Debugger pauses:
If you want the Debugger to pause at every error, set the number of errors to
zero.
If you want the Debugger to pause after a specified number of errors, set the
number of errors greater than zero. For example, if you set the number of errors
to five, the Debugger skips five errors and pauses at every sixth error.
The Integration Service uses the following rules to evaluate error breakpoints:
The Integration Service encounters a null input value, and the port contains a
user-defined default value of ERROR ( ).
The Integration Service encounters an output transformation error, and the port
contains the system default value of ERROR ( ). The following errors are
considered transformation errors:
-
Data conversion errors, such as passing a string to date
-
Expression evaluation errors, such as dividing by zero
- Calls to the ERROR function in an expression
The Integration Service encounters a null input value or transformation output
error, and the port contains a user-defined default value of ABORT ( ).
The Integration Service encounters a fatal error.
If the Integration Service encounters an error when it processes a
transformation, it evaluates error breakpoints for that transformation and global
error breakpoints. If any error breakpoint evaluates to true, the Debugger
pauses and does not evaluate data breakpoints.
Note: When the Integration Service encounters a fatal error or an ABORT, the
Debugger breaks even if it has not reached the configured number of errors to
skip.
When you create a data breakpoint, the Debugger pauses when the data
breakpoint evaluates to true. You can set the number of rows to skip or a data
condition or both. You have the following options when you set data breakpoints:
If you want the Debugger to pause at every row, set the number of rows to zero
and do not set a data condition.
If you want the Debugger to pause after a specified number of rows passes
through the transformation, set the number of rows greater than zero. For
example, if you set the number of rows to three, the Debugger skips three rows
of data and pauses every fourth row.
If you want the Debugger to pause each time the data meets a data condition,
enter the data condition and set the number of rows set to zero.
If you want the Debugger to pause at designated intervals when a row meets
the data condition, you can enter the data condition and set the number of rows
greater than zero. For example, if you set the number of rows to three, the
Debugger skips three breakpoint rows that meet the condition and pauses at
every fourth row.
Table 9-1 summarizes the options when you set data breakpoint types and
conditions:
When you create a data condition, you enter a global parameter or a parameter
for a single transformation. You have different options depending on the selected
instance and the type of condition you create.
Use the following syntax when you evaluate a transformation against a port or
constant value:
Use the following syntax when you check for null and default values, either
globally or in a transformation:
<port> <operator>
For a single transformation, you can enter multiple conditions within one
breakpoint if you want the Debugger to pause when all the conditions are true.
You can also enter multiple breakpoints for a single transformation if you want
the Debugger to pause when at least one condition is true.
Table 9-2. Condition Parameters for Data Breakpoints
Parameter Transformation Options Global Options
Port Choose port name, <<ROW- <ANY-PORT>. You can evaluate
ID>>, <<ROW-TYPE>>, or this condition against each port in
<<ANY-PORT>>. each transformation and mapplet.
Operator <, <=, =, >, >=, !=, ISNULL, ISNULL, ISDEFAULT.
ISDEFAULT.
Type Constant, Port. Evaluate against Not available.
a constant value or another port
in the transformation.
Value Enter the value or select the port Not available.
name.
When you enter a transformation data condition, you can select a specific port in
the transformation, or you can select from the following port parameters:
Note: For best results with port-to-port comparison, use ports that have the same
datatype. When you compare ports that have different datatypes, the Integration
Service converts the datatype of the upstream port to the datatype of the
downstream port before it compares the ports, which might result in an invalid
comparison.
When you enter a global data condition, enter a condition that the Integration
Service evaluates null and error default values in every port in every
transformation. You can choose <ANY-PORT> <ISNULL> or <ANY-PORT>
<ISDEFAULT>.
You can create ISNULL and ISDEFAULT conditions in transformation and global
data breakpoints. When you use the ISNULL or ISDEFAULT operator, you
cannot use the type or value in the condition.
When you create an ISNULL condition, the Debugger pauses when the
Integration Service encounters a null input value, and the port contains the
system default value.
The Integration Service encounters an output transformation error, and the port
contains a user-defined default value of a constant value or constant
expression.
The Integration Service encounters a null input value, and the port contains a
user-defined default value of a constant value or constant expression.
To enter breakpoints:
Editing a Breakpoint
You might want to review breakpoints before or during a Debugger session. You
can edit, disable, or remove breakpoints within the Breakpoint Editor.
To edit breakpoints:
1.In a mapping, open the Breakpoint Editor in one of the following ways:
Press Alt+F9.
Click Mappings > Debugger > Edit Breakpoints.
Right-click a transformation and choose Edit Breakpoint.
Note: You can right-click over any portion of an iconized transformation or
mapplet. If the transformation is in normal view, right-click over the title bar.
2.Select an instance name in the Instance Name section.
Tip: Select <<ALL INSTANCES>> in the Instance Name list to view all
breakpoints for a mapping.
3.Select a breakpoint in the Breakpoints section.
4.Change the condition or breakpoint type.
Clear the check box by a breakpoint to disable it. You can enable the
5.breakpoint again by selecting the check box.
6.Create a new breakpoint using the instructions above for creating breakpoints.
7.Click the Remove button to remove a selected breakpoint.
Click the Remove All button to remove all breakpoints for the selected instance.
If you want to remove all breakpoints in the mapping, select <<ALL
8.INSTANCES>>.
Configuring the Debugger
In addition to setting breakpoints, you must also configure the Debugger. Use the
Debugger Wizard in the Mapping Designer to configure the Debugger against a
saved mapping. When you configure the Debugger, enter parameters such as
the Integration Service, source and target type, and memory parameters. You
must enable debugging in the Integration Service configuration before you use it
to run the Debugger.
Introduction. This page gives you an overview of the wizard. You do not
1.configure any properties on this page.
Integration Service and session type. Choose the Integration Service to run
the session. You can also choose to run the Debugger against an existing non-
reusable session, an existing reusable session, or create a debug session
instance. When you run the Debugger against an existing session, the
Integration Service runs the session in debug mode. When you create a debug
session, you configure a subset of session properties within the Debugger
2.Wizard, such as source and target location.
Session information. If you run the Debugger against an existing session,
select the session name. If you create a debug session, configure session
3.parameters.
Session configuration. If you create a debug session, set the session
4.configuration.
5.Target options. Choose to load or discard target data.
The first page of the Debugger Wizard provides an overview of the wizard.
Integration Service to run the session. The list displays all Integration Services
associated with the repository. Choose an Integration Service that has
debugging enabled.
Run the Debugger against an existing non-reusable session, an existing
reusable session, or create a debug session instance. If you want to debug a
mapping that uses session properties, such as incremental aggregation, FTP, or
pre- or post-session commands, you must run an existing session in debug
mode.
When you click Next, the Designer tests the connection to the Integration Service
and verifies that debugging is enabled for the Integration Service. If the
connection fails, the Designer prompts you to select another Integration Service.
The page that the wizard displays for session information depends on whether
you choose to run a debug session or an existing session in debug mode.
Running an Existing Session in Debug Mode
If you choose to run an existing session in debug mode, the Debugger Wizard
displays a list of all sessions in the current folder that use the mapping. Select
the session you want to use.
You cannot run the Debugger against a session configured with multiple
partitions or a session configured to run on a grid. You must either change the
properties of the session or choose to create a debug session for the mapping.
If you choose to run a debug session, you can specify some session parameters.
The Debugger uses default session parameters for all other parameters that you
cannot configure with a debug session. The Debugger Wizard displays a session
page that contains the following tabs:
When you run a debug session, the Integration Service uses default session
properties for all properties that you do not configure in the Debugger Wizard.
You can select source and target connections for each source and target
instance in the debug session on the Connections tab.
You can choose the source reader type and target writer type for each source
and target instance in the debug session on the Reader/Writer tab.
The Properties tab displays different source and target properties depending on
the type of reader or writer you select on the Reader/Writer tab. The Integration
Service uses default values for all session properties you do not configure on the
Properties tab.
When you set the debug session configuration, you configure information such
as the location of files, row type, and memory.
On the last page of the Debugger Wizard, you can select the following target
options:
Discard target data. You can choose to load or discard target data when you
run the Debugger. If you discard target data, the Integration Service does not
connect to the target.
Display target data. You can select the target instances you want to display in
the Target window while you run a debug session.
When you click Finish, if the mapping includes mapplets, the Debugger displays
the mapplet instance dialog box. Select the mapplets from this dialog box that
you want to debug. To clear a selected mapplet, press the Ctrl key and select the
mapplet.
When you select a mapplet to debug, the Designer expands it to display the
individual transformations when the Debugger runs.
When you do not select a mapplet to debug, the Designer does not expand it in
the workspace. You cannot complete the following tasks for transformations in
the mapplet:
When you complete the Debugger Wizard, the Integration Service starts the
session and initializes the Debugger. After initialization, the Debugger moves in
and out of running and paused states based on breakpoints and commands that
you issue from the Mapping Designer. The Debugger can be in one of the
following states:
Note: To enable multiple users to debug the same mapping at the same time,
each user must configure different port numbers in the Tools > Options > Debug
tab.
Initializing State
When you run the Debugger, the Designer connects to the Integration Service,
and the Integration Service initializes the session. During initialization, the
Designer closes the Navigator window and disables functions, such as switching
to another tool, saving the repository, or opening a folder. These functions
remain disabled until the Debugger stops.
Running State
When initialization completes, the Debugger moves to the paused state and
waits for the command to continue processing. When you continue, the
Debugger moves to the running state. The Integration Service transforms data
and evaluates data against breakpoint conditions. The Debugger remains in the
running state until the Integration Service encounters a breakpoint, you issue a
break command, or the session ends.
Paused State
The Debugger pauses when the Integration Service encounters a break. The
following break conditions cause the Debugger to pause:
While the Debugger pauses, you can review and modify transformation output
data. The Debugger remains paused until you continue or end the session.
Debugger Tasks
You can perform multiple tasks when you run the Debugger. The type of
information that you monitor and the tasks that you perform can vary depending
on the Debugger state. For example, you can monitor logs in all three Debugger
states, but you can only modify data when the Debugger is in the paused state.
You can complete the following types of tasks:
Monitor the session. While the Integration Service runs the Debugger, the
Mapping Designer displays indicators and windows to help you monitor the
session. For more information about monitoring the session, see Monitoring the
Debugger.
Modify data and breakpoints. When the Debugger pauses, you can modify
output data, row indicators, and breakpoint conditions. For more information
about modifying data and breakpoints, see Modifying Data.
Evaluate expressions. When the Debugger pauses, you can invoke the
Expression Editor and evaluate an expression against the current data in a
transformation. The Debugger returns the result of the expression in a message
box. You can enter expressions using ports in the selected transformation. You
can also evaluate mapping variables. For more information about evaluating
expressions, see Evaluating Expressions.
Issue commands to the Integration Service. You can issue commands to the
Integration Service, such as break, continue, or stop.
Table 9-4 describes the different tasks you can perform in each of the Debugger
states:
When you run the Debugger against mappings with sequence generators and
mapping variables, the Integration Service might save or discard persisted
values:
Discard persisted values. The Integration Service does not save final values
of generated sequence numbers or mapping variables to the repository when
you run a debug session or you run a session in debug mode and discard target
data.
Save persisted values. The Integration Service saves final values of generated
sequence numbers and mapping variables to the repository when you run a
session in debug mode and do not discard target data. You can view the final
value for Sequence Generator and Normalizer transformations in the
transformation properties.
Designer Behavior
When the Debugger starts, you cannot perform the following tasks:
When you run the Debugger, you can monitor the following information:
The Mapping Designer displays windows and debug indicators that help you
monitor the session:
While you monitor the Debugger, you might want to change the transformation
output data to see the effect on subsequent transformations or targets in the data
flow. You might also want to edit or add more breakpoint information to monitor
the session more closely.
When the Debugger pauses, it displays the current row of data in the Instance
window for the transformation in the mapping or mapplet where the Integration
Service encountered the break. This is the current transformation. You can view
the data of any transformation at the point where the Debugger pauses by
selecting another transformation from the list in the Instance window.
If you did not select any mapplet to debug after completing the Debugger Wizard,
you cannot monitor or view transformations inside the mapplet when the
Debugger runs.
Click Tools > Options > Debug tab to select columns to display in the Debugger
Data Display window. For more information about displaying columns, see
Configuring Debug Options.
Port name. Displays all ports that are connected to another transformation or
target.
RowID. Displays row number passing through the transformation.
Value. Displays the value for each port. If the port contains binary data, this
column displays <raw data>. If the port does not contain data, or if it is NULL,
this column displays <no data available>. For Router transformations, the
values display for input ports and output ports that meet the group condition.
Output ports that do not meet the group condition display <no data available> in
the value column.
Datatype. Displays the datatype of the port.
Length/precision and scale. Displays the length/precision and scale of the
port.
Null indicator. If a column contains a null value, the null indicator column is
selected, and the value displays <no data available>.
Row type. Insert, update, delete, reject, filtered, or not applicable. <<ROW
TYPE>> displays in the Port column, and the row type value displays in the
Value column. The row type does not display if it is not applicable, such as with
Sequence Generator transformations.
Port indicator. Displays one of the following indicators next to the port name:
-
Current row. Indicates the port is in the current row.
-
Previous row. Indicates the port is in the previous row.
-Current row, default value. Indicates the value for the column in the current
row is the default value.
-Previous row, default value. Indicates the value for the column in the previous
row is the default value.
-Current row, modifiable. Indicates an output port in the current row that you
can modify.
Tip: Move the pointer across the port indicator to display tooltips about the
indicator.
After you review or modify data, you can continue the Debugger in the following
ways:
Continue to the next break. To continue to the next break, click Continue on
the toolbar or from the Mapping > Debugger menu option. The Debugger
continues running until it encounters the next break.
Continue to the next instance. To continue to the next instance, click Next
Instance on the toolbar or from the Mapping > Debugger menu option. The
Debugger continues running until it reaches the next transformation or until it
encounters a break. If the current instance has output going to more than one
transformation instance, the Debugger stops at the first instance it processes. If
you did not select a mapplet to debug when you completed the Debugger
Wizard steps, the Debugger continues to the instance after the mapplet.
Step to a specified instance. To continue to a specified instance, select the
transformation instance in the mapping, then click Step to Instance on the
toolbar or from the Mapping > Debugger menu option. The Debugger continues
running until it reaches the selected transformation in the mapping or until it
encounters a break.
You can step to connected transformations in the mapping, even if they do not
have an associated breakpoint. You cannot step to the following instances:
-
Sources
-
Targets
-
Unconnected transformations
-
Mapplets not selected for debugging
Monitoring Target Data
When the Debugger runs, the Designer caches the target data. You can view the
cached data in the Target window while the Debugger is running or paused. You
can view cached target data even if you configure the Debugger Wizard to
discard target data.
You can view the following information for each row of target data:
If the mapping has more than one target, you can choose the target you want to
display. Select a target to view from the list in the Debugger Target Display
window. The targets that display in the list are the targets you selected in the
Debugger Wizard. If you want to view a target that you did not select in the
wizard, click Mappings > Debugger > View Target Data.
The Target window displays up to 1,000 rows. After it reaches 1,000 rows, the
Designer begins overwriting data from the first row. You can clear the cache and
the Debugger Target Display window by right-clicking in the Debugger Target
Display window, and selecting Clear Data.
When the Debugger initializes, the Integration Service begins writing the debug
log in the Debugger tab of the Output window. The Integration Service writes the
following types of messages to the debug log:
Session initialization
Acknowledge user request
The Integration Service encounters a break
Debug errors
Debugger status
Session stops
When the bottom line in the Output window reads that the Integration Service is
ready, you know the Debugger is paused. The Integration Service remains
paused until you issue a command, such as Continue, Step to Next, or Stop.
Note: If the Debugger does not start or if it abruptly stops, and the Integration
Service does not write any message to the Output window, you can look in the
Administration Console Domain page for more information.
Table 9-5 shows samples of debug log messages in the Output window:
You can view running and completed workflows and sessions in the Workflow
Monitor. The Integration Service uses a debug workflow to run the debug
session. The Workflow Monitor displays the debug workflow and session names
differently depending on the session type you chose in the Debugger Wizard.
Table 9-6 describes the workflow and session names the Workflow Monitor
displays for each debug session type:
Table 9-6. Workflow Monitor Display Names for Debug Session Types
Session Workflow Name Session Name
Type
Existing DebugWorkflow_mappingnam DebugInst_sessionname
reusable e
session
Existing workflowname sessionname
non-
reusable
session
Debug DebugWorkflow_mappingnam DebugInst_DebugSession_mappingnam
session e e
The Workflow Monitor displays the debug run mode in the Run Type column for
all debugger sessions and workflows. You can also access the logs through the
Workflow Monitor.
Modifying Data
When the Debugger pauses, the current instance displays in the Instance
window, and the current instance indicator displays on the transformation in the
mapping. You can make the following modifications to the current instance when
the Debugger pauses on a data breakpoint:
Modify output data. You can modify output data of the current transformation.
When you continue the session, the Integration Service validates the data. It
performs the same validation it performs when it passes data from port to port in
a regular session.
Change null data to not-null. Clear the null column, and enter a value in the
value column to change null data to not-null.
Change not-null to null. Select the null column to change not-null data to null.
The Designer prompts you to confirm that you want to make this change.
Modify row types. Modify Update Strategy, Filter, or Router transformation row
types.
For Router transformations, you can change the row type to override the group
condition evaluation for user-defined groups. For example, if the group condition
evaluates to false, the rows are not passed through the output ports to the next
transformation or target. The Instance window displays <no data available>, and
the row type is filtered. If you want to pass the filtered row to the next
transformation or target, you can change the row type to Insert. Likewise, for a
group that meets the group condition, you can change the row type from insert to
filtered.
After you change data, you can refresh the cache before you continue the
session. When you issue the Refresh command, the Designer processes the
request for the current transformation, and you can see if the data you enter is
valid. You can change the data again before you continue the session.
Restrictions
Evaluating Expressions
When the Debugger pauses, use the Expression Editor to evaluate expressions
using mapping variables and ports in a selected transformation.
Aggregator transformation
Expression transformation
Filter transformation
Rank transformation
Router transformation
Update Strategy transformation
When you create an expression, you use references to ports within the
transformation. The Expression Editor does not display ports for other
transformations in the mapping. When you evaluate the expression, the
Debugger returns the result of the expression in a message box.
If you define variables in the mapping, you can evaluate the start value or current
value of the mapping variable. To find the start value of a mapping variable,
evaluate the mapping variable only.
The Debugger uses the following process to determine the start value of a
mapping variable:
Parameter file. If you use a parameter file, the Debugger returns the value in
1.the parameter file.
Repository. If you do not use a parameter file, the Debugger returns the value
2.in the repository.
3.Initial value. If the repository does not have a stored value for the variable, the
Debugger returns the initial value configured in the mapping variable.
Default value. If you do not configure an initial value for the mapping variable,
4.the Debugger returns the default value based on datatypes.
To find the current value of a mapping variable, evaluate the mapping variable
with one of the variable functions, such as SetMaxVariable or SetCountVariable.
The Designer displays only the mapping variables associated with the
transformations in the mapping. To view mapping variables associated with a
mapplet, select the transformation within the expanded mapplet when the
Debugger is running.
1.Open the mapping with breakpoints and configuration that you want to save.
2.Click Mappings > Debugger > Save Configuration.
3.Save the file with a .dcf extension.
When you choose an existing .dcf file, the Designer appends the configuration
4.information to the file.
If the file contains configuration information for the mapping, the Designer
5.prompts you to verify that you want to overwrite the configuration.
Make the .dcf file accessible to the PowerCenter Client machine where you
1.want to load configurations.
2.Open the mapping you want to load configuration.
3.Click Mapping > Debugger > Load Configuration.
The Open DCF File dialog box appears.
4.Select the .dcf configuration file and click Open.
If there are multiple configurations in the file, or if the Designer does not find a
matching mapping name, the Designer displays a list of mapping configurations
in the file.
5.Select a mapping and click OK.
The Designer loads all breakpoint and configuration for matching mapping
objects. It loads all configuration that is not dependent on mapping objects, such
as the Integration Service and the option to discard target data.