Documente Academic
Documente Profesional
Documente Cultură
cover
Front cover
Student Exercises
ERC 1.0
Student Exercises
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International
Business Machines Corp., registered in many jurisdictions worldwide.
The following are trademarks of International Business Machines Corporation, registered in
many jurisdictions worldwide:
AIX AS/400 DataStage
DB2 HACMP InfoSphere
iSeries pSeries QualityStage
WebSphere xSeries zSeries
Intel and Intel Core are trademarks or registered trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
Lenovo and ThinkPad are trademarks or registered trademarks of Lenovo in the United
States, other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other
countries, or both.
VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are registered
trademarks or trademarks (the "Marks") of VMware, Inc. in the United States and/or other
jurisdictions.
Other product and service names might be trademarks of IBM or other companies.
TOC Contents
Exercises description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Exercise 12. Using the Join, Merge, and Funnel stages . . . . . . . . . . . . . . . . . . . . 12-1
Task: Use the Join stage in a job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Task: Use the Merge stage in a job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5
Task: Use the Funnel stage in a job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
pref
viii IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
This exercise introduces the Information Server Web Console.
Requirements
This lab must be taken using the course VMWare images or the
equivalent configuration as described in the Lab Setup Guide.
Copyright IBM Corp. 2012 Exercise 1. Log onto the Information Server Web Console 1-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
1-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Copyright IBM Corp. 2012 Exercise 1. Log onto the Information Server Web Console 1-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Click Login. If you see the following window, Information Server is up and running.
1-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
In this exercise you learn how DataStage user IDs are created in the
IS Web Console. Then you will log onto DataStage Administrator and
configure your DataStage environment.
Requirements
Exercise 1 was completed and the IS Information Web console is
open.
2-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 8. Note the first and last names of this user. Expand the Suite and Suite Component
folders. Note what Suite roles and Product roles have been assigned to this user.
__ 10. Click New User. Create a new user ID named dsadmin. Use dsadmin for the first
and last names and password as well. Assign Suite User role and DataStage and
QualityStage Administrator Suite Component role to this user.
2-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 12. Following the same procedure, create an additional user named dsuser. Assign
Suite User and DataStage and QualityStage User roles to dsuser (password is
also dsuser).
__ 13. Click Save and Close. Verify that dsuser and dsadmin have been created.
__ 2. Specify the host name (EDSERVER.IBM.COM). Type dsadmin in the User name
and Password boxes. Specify your DataStage server, here EDSERVER.IBM.COM.
__ 3. Click Login.
2-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 5. Click OK.
2-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 6. On the Parallel tab, check the box to make the generated OSH visible. Note the
default date and time formats. For example, the default date format is
YYYY-MM-DD, which is expressed by the format string shown.
2-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 2. Click Add User or Group. Notice that dsuser is available to be added. Select
dsuser and then click Add.
__ 3. Click OK to return to the Permissions tab. Select dsuser. In the User Role box,
select the DataStage Developer role.
__ 7. Click on the Logs tab. Select the Auto-purge of job log box and set the
Auto-purge action to up to 2 previous job runs.
2-12 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
This exercise introduces Designer client and covers the import and
export functionality.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 3. Importing and exporting DataStage objects 3-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
3-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Copyright IBM Corp. 2012 Exercise 3. Importing and exporting DataStage objects 3-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Click OK.
3-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 6. Open up the table definition you have imported. You will find it in the
_Training>Metadata folder. It is named Employees.txt.
__ 7. Click the Columns tab. Note the column definitions and their types.
Copyright IBM Corp. 2012 Exercise 3. Importing and exporting DataStage objects 3-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
3-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Copyright IBM Corp. 2012 Exercise 3. Importing and exporting DataStage objects 3-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
3-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
Table definitions are loaded into stages in a job. A table definition for a
sequential file will be loaded into a Sequential File stage in order for
the stage to read the sequential file.
Requirements
No new requirements.
Note
For your convenience a copy of this file has been placed on your Client system in your
DSEss_Files folder. The file that you will import a table definition for and the file that the
DataStage job reads must be on the DataStage Server system, where the job runs.
4-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 7. Click Import.
__ 8. Specify the general format on the Format tab. Be sure to specify that the first line is
column names, if this is the case. Then DataStage can use these names in the
column definitions.
__ 9. Click Preview to view the data in your file in the specified format. This is a check
whether you have defined the format correctly. If it looks like a mess, you have not
correctly specified the format. In the current case, everything looks fine.
4-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 10. Click the Define tab to examine the column definitions.
Information
If the table definition is not in _Training\Metadata in Designer, look for it in the Table
Definitions folder, where table definitions go by default. You may move the Table Definition
from there to _Training\Metadata by drag and drop.
__ 13. Click on the Columns tab to examine the imported column definitions.
__ 14. Click on the Format tab to examine the format specification. Notice the delimiter and
that the first row contains column names.
4-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
Building a DataStage parallel job, however complex, involves the
same basic workflow. This exercise introduces you to that workflow.
Later exercises will introduce additional functionality into the workflow.
Requirements
No new requirements.
5-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 5. Open up the Row Generator stage to the Columns tab. Click the Load button to
load the column definitions from the Employees.txt table definition you imported in
an earlier lab.
5-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 2. Click your right mouse button over an empty part of the canvas. Select or verify that
Show performance statistics is enabled.
__ 3. Run your job by clicking on the Run icon.
__ 4. Click Apply then Next. For the Name column, specify that you want to cycle through
three names, your choice.
__ a. Select Generator in the Properties panel, and then click Algorithm.
__ b. Choose cycle from the drop down menu on the right.
__ c. Click on Value. In the Value field add a name for the first value.
__ d. Press Enter to add a second value.
__ e. Repeat to add a third value.
5-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ c. Click Close.
__ 7. Click View Data to see the data that will be generated.
5-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 4. Open up the Properties tab of the Row Generator stage in your job. Select the
Number of Records property, and then click on the right-pointing arrow to select
your parameter. Use your NumRows job parameter.
5-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty 3. Double-click on the parameter set icon. Name the parameter set
RowGenTarget.
4. Click the Parameters tab. Create the NumRows parameter shown along with
the default value shown (100).
5. Click the Values tab. Create two values files. The first is named LowGen and
uses the default values for the NumRows parameter. The second changes the
default value of the NumRows parameter to 10000.
5-12 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty 14. Select the NumRows parameter from the parameter set as the value for the
property.
18. Click Run. Verify that the job generates 10000 records.
5-14 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
Sequential files are one type of data that enterprises commonly need
to process. The primary way of reading and writing to sequential files
in a DataStage job uses the Sequential File stage.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 6. Reading from and writing to sequential files 6-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. In the source Sequential File stage Columns and Format tabs, load the format and
column definitions from the Selling_Group_Mapping.txt table definition you
imported in a previous exercise.
__ 4. On the Properties tab specify a path to the file to read, namely the
Selling_Group_Mapping.txt file. Here, also set the First Line is Column Names
property to True. If you do not, your job will have trouble reading the first row and
issue a warning message in the job log.
6-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 5. Click View Data to verify that the metadata has been specified properly in the stage.
__ 6. In the Copy stage Output>Mapping tab, drag all the columns across from the
source to the target.
Copyright IBM Corp. 2012 Exercise 6. Reading from and writing to sequential files 6-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
6-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 4. Open up your target stage to the Properties tab. Select the File property. In the File
text box retain the directory path. Replace the name of your file by your job
parameter.
Copyright IBM Corp. 2012 Exercise 6. Reading from and writing to sequential files 6-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. On the Properties tab of each Sequential File stage, change the Reject Mode
property value to Output.
__ 3. Compile and run. Verify that it is running correctly. You should not have any rejects,
errors, or warnings.
__ 4. To test the rejects link, temporarily change the property First Line is Column
Names to False in the source stage and then recompile and run. This will cause the
first row to be rejected because the values in the first row, which are all strings, will
not match the column definitions, some of which are integer types.
6-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 5. Examine the job log. Look for a warning message indicating an import error in the
first record read (record 0). Also open the SourceRejects Peek stage message. Note
the data in the row that was rejected.
Copyright IBM Corp. 2012 Exercise 6. Reading from and writing to sequential files 6-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. Open the Copy stage. Click the Output>Mapping tab. Then select the link to your
Peek stage (ToPeek) from the Output name box.
6-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 4. Click on the Columns tab. Change the name of the second column to SG_Desc.
Copyright IBM Corp. 2012 Exercise 6. Reading from and writing to sequential files 6-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. Compile and run your job. View the messages written to the log by the Peek output
stage.
6-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Note
You will receive some warning messages related to the first row. And this row will be
rejected. You can safely ignore these.
Copyright IBM Corp. 2012 Exercise 6. Reading from and writing to sequential files 6-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Click View Data to verify that you can read the files.
__ 5. Compile and run the job. View the job log.
__ 6. Click View Data over the target stage to verify the results. There should be two
copies of each row, since you are now reading two identical files. You can use the
Find button in the View Data window to locate both copies.
6-12 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
NULL values enter into the job stream in a number of places in
DataStage jobs. This exercise looks at how they are handled in the
context of reading from and writing to sequential files.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 7. Reading and writing NULL values to a sequential file 7-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
7-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty
Note
Although your DataStage jobs read sequential files in your DSEss_Files directory on the
DataStage server system, copies of these files have been placed on your client system, for
your convenience.
__ 4. Notice in the data that the Special_Handling_Code column contains some integer
values of 1. Notice also that the last column (Distr_Chann_Desc) is missing some
values. To test how to read NULLs, let us assume that 1 in the third column means
NULL and that the absence of a value in the last column means NULL. In the
following steps, you will specify this.
__ 5. Open up the source Sequential stage to the Columns tab. Double-click to the left of
the Special_Handling_Code column to open up the Edit Column Meta Data
window.
Copyright IBM Corp. 2012 Exercise 7. Reading and writing NULL values to a sequential file 7-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. Change the Nullable field to Yes. Notice that the Nullable folder shows up in the
Properties window. Select this folder and then add the Null field value property.
Specify a value of 1 for it.
7-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty NULL. To do this specify back-to-back double quotes. Click Apply and then
Close.
Copyright IBM Corp. 2012 Exercise 7. Reading and writing NULL values to a sequential file 7-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 11. Compile and run your job. It should abort since NULL values will be written to
non-nullable columns on your target. View the job log to see the messages.
7-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 5. Now, let us handle the NULL values. That is, we will specify values to be written to
the target file that represent NULLs. For the Special_Handling_Code column we
will specify a value of -99999. For the Distribution_Channel_Description column
we will specify a value of UNKNOWN.
Copyright IBM Corp. 2012 Exercise 7. Reading and writing NULL values to a sequential file 7-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. Open up the target stage and specify these values. The procedure is the same as
when the Sequential stage is used as a source. Shown below is the specification for
the Special_Handling_Code column.
__ 7. Compile and run your job. View the job log. You should not get any errors or rejects.
__ 8. Click View Data to verify the results.
Note
When you view the data in DataStage, all you will see is the word NULL, not the actual
values. To see those values you would need to open up the data file on the DataStage
server system in a text editor.
7-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
Data Sets are suitable as temporary staging files between DataStage
jobs.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 8. Working with data sets 8-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. Open the source stage and add the optional property to read the file using multiple
readers per node. Click Yes when confronted with the warning message. Then
change the value of the property to 2. (This will ensure that data is written to more
than one partition.)
__ 6. Compile and run your job. Check the job log for errors. You can safely ignore the
warning message about record 0.
8-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Copyright IBM Corp. 2012 Exercise 8. Working with data sets 8-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. Click the Show Data Window icon at the top of the window. Select partition number
1. This will display the data in just the second partition.
8-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
The configuration file determines the number of nodes (partitions) that
a job runs under. Partitioning algorithms that can be set in each stage
determines how the data gets put into the partitions.
Requirements
No new requirements.
2. Note the icon on the input link to the target stage (fan-in). It indicates that the
stage is collecting the data.
3. Open up the target Sequential File stage to the Input>Partitioning tab. Note the
collecting algorithm (Auto) that is selected.
9-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
7. Click on the Partitioning tab. Notice that the stage is no longer collecting, but
now is partitioning. You can see this by noting the words on top of the
8. Click OK to close the stage. Notice that the partitioning icon has changed. It no
longer indicates collecting. The icon you see now indicates Auto partitioning.
9-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty 9. Now open the target Sequential File stage again. This time change the
partitioning type to Same.
10. Close the stage. Notice how the partitioning icon has changed.
12. View the job log. Notice how the data is exported to the two different partitions (0
and 1). 23 records go into one partition (partition 1) and 24 records go into the
other (partition 0).
9-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
9-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty section lists the nodes each operator runs on. For example, op0 runs on just the
single node, node1. Notice that op3 (TargetFile) runs on two nodes.
9-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
There are several stages that can be used to combine data. This
exercise and the next explore the Lookup stage.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 10. Using the Lookup stage 10-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. Import the table definition for the Warehouse.txt sequential file to your
_Training>Metadata folder.
__ 3. Edit the Warehouse Sequential File stage. Warehouse.txt will be the source file
from which data will be extracted. The format properties identified in the table
10-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty definition will need to be duplicated in the Sequential File stage. Be sure you can
view the data. If there are problems, check that the metadata is correct on both the
Columns and the Format tabs.
__ 4. Import the table definition for the Items.txt file.
__ 5. Edit the Items Sequential File stage to extract data from the Items.txt file. Also, on
the Format tab, change the quote character to the single quote (). This is because
some of the data contains double quotes as part of the data.
__ 6. Again, be sure you can view the data in the Items stage before continuing.
__ 7. Open the Lookup stage. Map the Item column in the top left pane to the lookup Item
key column in the bottom left pane of the Items table panel, by dragging the one to
Copyright IBM Corp. 2012 Exercise 10. Using the Lookup stage 10-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
the other. If the Confirm Action window appears, click Yes to make the Item column
a key field.
__ 8. Drag all the Warehouse panel columns to the Warehouse_Items target link on the
right.
__ 9. Drag the Description column from the Items panel to just above the Onhand target
column in the Warehouse_Items panel.
10-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 10. On the Warehouse_Items tab at the bottom of the window, change the name of the
Description target column, which you just added, to ItemDescription.
Copyright IBM Corp. 2012 Exercise 10. Using the Lookup stage 10-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Compile and run. Examine the log. You should not get any fatal errors this time.
__ 4. View the data in the target file. Do you find any rows in the target file in which the
lookup failed? These would be rows with missing item descriptions. Increase the
number of rows displayed to at least a few hundred, if you do not initially see any
missing items. By default, when there is a lookup failure with Continue, DataStage
outputs empty values to the lookup columns. If the columns are nullable, DataStage
outputs NULLs. If the columns are not nullable, DataStage outputs default empty
values depending on their type.
10-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 5. Open up the Lookup stage. Make both the Description column on the left side and
the ItemDescription column on the right side nullable. Now, for non-matches
DataStage will return NULLs instead of empty strings.
__ 6. Since NULLs will be written to the target stage, we will need to handle them. Open
up the target Sequential stage. Replace NULLs by the string NOMATCH. To do
this, double-click to the left of the ItemDescription column on the Columns tab. In
the extended properties, specify a null field value of NOMATCH.
Copyright IBM Corp. 2012 Exercise 10. Using the Lookup stage 10-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 8. View the data in the target Sequential File stage. Click Find. Type NULL in the Find
what: box. Select ItemDescription from the In column: drop down. Click Find
Next to locate the first NULL value.
10-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 3. Close the Lookup stage and then add a rejects link going to a Peek stage to capture
the lookup failures.
__ 4. Compile and run. Examine the Peeks in the job log to see what rows were lookup
failures.
Copyright IBM Corp. 2012 Exercise 10. Using the Lookup stage 10-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 5. Examine the job log. Notice in the Peek messages that a number of rows were
rejected.
10-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
A major capability in the Lookup stage are range lookups. Two type of
range lookups are supported. Those in which the range is specified on
the reference link and those in which the range is specified on the
stream link.
Requirements
No new requirements.
__ 2. Import the table definition for the Range_Descriptions.txt sequential file. The
StartItem and EndItem fields should be defined like the Item field is defined in the
Warehouse stage, namely, as VarChar(255).
11-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 4. Open the Lookup stage. Edit the Description column on the left and the
ItemDescription column on the right so that both are nullable.
__ 5. Select the Range checkbox to the left of the Item field in the Warehouse table
window.
__ 6. Double-click on the Key Expression cell for the Item column to open the Range
Expression editor. Specify that the Warehouse.Item column value is to be greater
than or equal to the StartItem column value and less than the EndItem column
value.
__ 7. Open the Constraints window and specify that the job is to continue if a lookup
failure occurs.
__ 8. Edit the target Sequential File stage. The ItemDescription column in the Sequential
File stage is nullable. Go to the extended properties window for this column.
Replace NULL values by the string NO_DESCRIPTION.
11-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 3. Open up your Lookup stage. Select the Item column in the Warehouse table as the
key. Specify the Key type as Range.
__ 4. Double-click on the Key Expression cell next to Item. Specify the range
expression.
__ 5. Click the Constraints icon. Specify that multiple rows are to be returned from the
Warehouse link. Also specify that the job is to continue if there is a lookup failure.
11-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
Several stages can be used to combine data. This exercise looks at
the Join, Merge, and Funnel stages.
Requirements
You have a working LookupWarehouseItem job.
Copyright IBM Corp. 2012 Exercise 12. Using the Join, Merge, and Funnel stages 12-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Verify that you can view the data in the Warehouse stage.
__ 4. Verify that you can view the data in the Items stage.
__ 5. Open the Join stage. Join by Item. Specify a Right Outer join.
12-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 6. Click the Link Ordering tab. Make Warehouse the Right link by selecting either
Items or Warehouse and clicking an up or down arrow as appropriate.
__ 7. Click the Output>Mapping tab. Be sure all columns are mapped to the output.
__ 8. Edit the target Sequential File stage. Edit or confirm that the job writes to a file
named WarehouseItems.txt in your lab files Temp directory.
Copyright IBM Corp. 2012 Exercise 12. Using the Join, Merge, and Funnel stages 12-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 9. Compile and run. Verify that the number of records written to the target sequential
file is the same as were read from the Warehouse.txt file, since this is a Right
Outer join.
__ 10. View the data. Verify that the description is joined onto each Warehouse file record
of columns.
12-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 2. In the Merge stage, specify that data is to be merged, with case sensitivity, by the
key (Item). Assume that the data is sorted in ascending order. Also specify that
unmatched records from Warehouse (the master link) are to be dropped.
Copyright IBM Corp. 2012 Exercise 12. Using the Join, Merge, and Funnel stages 12-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. On the Link Ordering tab, ensure that the Warehouse link is the master link.
__ 4. On the Output>Mapping tab, be sure that all input columns are mapped to the
appropriate output columns.
12-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty to be duplicate-free in the key column. A number of update records have also been
dropped because they did not match master records.
__ 7. The moral here is that you cannot use the Merge stage if your Master source has
duplicates. None of the duplicate records will match with update records.
__ 8. Recall that another requirement of the Merge stage (and Join stage) is that the data
is hash partitioned and sorted by the key. We did not do this explicitly, so why did our
job not fail? Let us examine the job log for clues. Open up the Score message.
__ 9. Notice that hash partitioners and sorts (tsort operators) have been inserted by
DataStage.
Copyright IBM Corp. 2012 Exercise 12. Using the Join, Merge, and Funnel stages 12-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. Edit the two source Sequential File stages to, respectively, extract data from the two
Warehouse files, Warehouse_031005_01.txt and Warehouse_031005_02.txt.
They have the same format and column definitions as the Warehouse.txt file.
__ 3. Edit the Funnel stage to combine data from the two files in Continuous Funnel
mode.
12-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 6. Compile and run. Verify that the number of rows going into the target is the sum of
the number of rows coming from the two sources. And view the result data.
Copyright IBM Corp. 2012 Exercise 12. Using the Join, Merge, and Funnel stages 12-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
12-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
In this exercise you will create a fairly complex job that contains all the
group processing stages listed above.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 13. Group processing stages 13-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. In the Copy stage, specify that all columns move through the stage to the output link
going to the Join stage. If necessary review instructions in Exercise 6 for configuring
a copy stage.
13-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 5. Specify that only the Selling_Group_Code column moves through the Copy stage
to the Aggregator stage.
__ 6. Edit the Aggregator stage. Specify that records are to be grouped by
Selling_Group_Code.
__ 7. Specify that the type of aggregation is Count Rows.
__ 8. Specify that the aggregation amount is to go into a column named CountGroup.
Define this column on the Output>Columns tab as an integer, length 10.
__ 9. Select Sort as the aggregation method, because the data has been sorted by the
grouping key column.
Copyright IBM Corp. 2012 Exercise 13. Group processing stages 13-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 10. On the Output>Mapping tab, send out the key column and the result column.
__ 11. Edit the Join stage. The join key is Selling_Group_Code. The join type is Left
Outer. Verify on the Link Ordering tab that the CopyToJoin link is the left link.
13-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Copyright IBM Corp. 2012 Exercise 13. Group processing stages 13-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 14. On the Input>Partitioning tab, select Same to guarantee that the partitioning going
into the stage will not change.
__ 15. Edit the Remove Duplicates stage. Group by Selling_Group_Code. Retain the last
record in each group. On the Output>Mapping tab, move all columns through the
stage.
13-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty which the data has been sorted. Double-click the columns to move them to the
Selected box.
__ 17. Compile and run. View the job log to check whether there are any problems.
Copyright IBM Corp. 2012 Exercise 13. Group processing stages 13-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 18. View the results. There should be fewer rows going into the target stage than the
number coming out of the source stage, because the duplicate records have been
eliminated.
__ 19. View the data in the target stage. Take a look at the CountGroup to see that you are
getting multiple duplicate counts for some rows.
13-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
This unit as a whole introduces the functionality of the Transformer.
This lab exercise covers how to define constraints.
Requirements
No new requirements.
__ 3. Open the source Sequential File stage. Edit it to read data from the
Selling_Group_Mapping_RangeError.txt file. It has the same metadata as the
Selling_Group_Mapping.txt file.
14-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 4. Open up the Transformer. Drag all the input columns across to both output link
windows.
__ 5. Double-click to the right of the word Constraint in either output link window. This
opens the Transformer Stage Constraints window.
__ 6. Double-click on the Constraint cell to the right of the LowCode link name to open
the Expression Editor. Click on the box with the ellipsis to choose pre-defined fields
and code. Use the Editor to define a condition that selects just rows with special
handling codes between 0 and 2 inclusive.
__ 7. Double-click on the Constraint cell to the right of the HighCode link name to open
the Expression Editor. Use the Editor to define a condition that selects just rows with
special handling codes between 3 and 6 inclusive.
__ 8. Edit the LowCode target Sequential File stage to write to a file named LowCode.txt
in the lab files Temp directory.
__ 9. Edit the HighCode target Sequential File stage to write to a file named
HighCode.txt in the lab files Temp directory.
__ 10. Compile and run your job.
__ 11. View the data in your target files to verify that they each contain the right rows. Here
is the LowCode.txt file data. Notice that it only contains rows with special handling
codes between 0 and 2.
14-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty Task: Use an Otherwise Link to capture range errors in the data
__ 1. Save your job as TransSellingGroupOtherwise.
__ 2. Add an additional link from the Transformer to another Sequential File stage and
label the new stage and link RangeErrors.
__ 3. In the Transformer, drag all input columns across to the new target link.
__ 5. Reorder the links so that the RangeErrors link is last in output link ordering.
(Depending on how you drew your links, this link may already be last.)
__ 6. Open the Constraints window. Select the Otherwise box to the right of your
RangeErrors link.
14-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 8. Compile and run your job. There should be a few range errors.
14-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
This unit as a whole introduces the functionality of the Transformer.
This lab exercise covers how to define constraints.
Requirements
You have a working TransSellingGroup job from the previous lab.
__ 3. Click the Stage Properties icon in the top left corner. Then click the Stage
Variables tab.
15-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 4. Create a stage variable named HCDesc. Set its initial value to the empty string. Its
SQL type is VarChar, precision 255.
__ 5. Close the Transformer Stage Properties window. The name of the stage variable
shows up in the Stage Variables window.
__ 6. Double-click in the cell to the left of the HCDesc stage variable. Define a derivation
that places each row's special handling code within a string of the following form:
Handling code = [xxx]. Here xxx is the value in the Special_Handling_Code
column.
__ 8. Drag the value of the HCDesc stage variable to each of these link columns.
15-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 9. Compile and run. View the data in the output files.
15-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Hint
Use the IF THEN ELSE operator. Also, you may need to use the substring operator and
Len functions.)
__ 3. Compile, run, and test your job. Here is some of the output from the HighCode
stage. Notice specifically, the row (550000), which shows the replacement of SG055
with SH055 in the second column.
15-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 4. Open up the Transformer and then click the Stage Properties icon (top left). Select
the Legacy null processing box (if it is not already selected).
__ 5. Compile and run your job. Your job probably will not have any rejects.
15-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
When processing input data in loops, each input row may result in
multiple output rows. In this exercise you will process input rows that
contain lists of colors. For each input row, you will extract a color from
the list and write it out as a separate row.
Requirements
No new requirements.
Task: Pivot
__ 1. The source data is contained in the ColorMappings.txt file. Each Item number is
followed by a list of colors.
__ 2. Create a new parallel job named TransPivot. Name the links and stages as shown.
__ 3. Import the table definition for the ColorMappings.txt file. Store it in your
_Training>Metadata folder.
16-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 4. Open the ColorMappings stage. Edit the stage so that it reads from the
ColorMappings.txt file. Verify that you can view the data.
__ 5. Open the Transformer stage. Drag the Item column across to the output link.
__ 6. Create a new VarChar(10) column named Color.
__ 7. Create a new integer stage variable named NumColors. This will store the number
of colors in the list of colors.
__ 8. Use the Count function to count the number of occurrences of the substring | in
the Colors input column. Store the result in the NumColors stage variable. Note
that the number of | delimiters in the color list is one less than the number of
colors.
__ 9. Open the Loop Condition window. Open the Expression Editor in the Loop While
box. Specify a loop condition that will iterate for each color. The total number of
iterations is stored in the NumColors stage variable. Use the @ITERATION system
variable.
__ 11. For each iteration, store the corresponding color from the colors list in the Color
loop variable. Use the Field function to retrieve the color from the colors list.
16-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 12. Drag the Color loop variable down to the derivation cell next to the Color output link
column.
__ 13. Edit the target stage to write to a sequential file named ItemColor.txt in your lab
files Temp directory.
__ 14. Compile and run your job. You should see more rows going into the target file than
coming out of the source file.
__ 15. View the data in the target stage. You should see multiple rows for each item
number.
__ 16. Test that you have the right results. For example, count the number of rows for item
16. There should be four, because the original item 16 has a list of four colors.
16-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
Several Transformer functions are available to you in the Transformer
to process groups of records. This exercise demonstrates how they
can be used. In this example, a group result is added to each
individual row.
In the second part of this exercise you will use the parallel job
debugger to debug a DataStage parallel job. You set breakpoints on
the links that contain the data you want to examine. You specify
conditions for the breakpoints. Then you run the job using the
debugger.
Requirements
Your lab files folder contains the Selling_Group_Mapping_Debug.txt
file. You have a working TransSellingGroupOtherwise job.
Copyright IBM Corp. 2012 Exercise 17. Group processing in the Transformer 17-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. Import a table definition for the ItemColor.txt file that you created in the previous
lab. Reminder: This file is located in the Temp directory rather than the
DSEss_Files directory. (If you did not previously create this file, you can use the
ItemColor_Copy.txt file in your lab files directory.) Below, a portion of the file is
displayed.
__ 3. Edit the source Sequential File stage to read data from the ItemColor.txt file.
17-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 4. Edit the Sort stage. Sort the data by the Item column.
Copyright IBM Corp. 2012 Exercise 17. Group processing in the Transformer 17-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 7. Open the Transformer stage. Drag the Item column across to the output link. Define
a new column named Colors as a VarChar(255).
__ 8. Create a Char(1) stage variable named IsLastInGroup. Initialize with N' (meaning
No).
17-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 9. Create a VarChar(255) stage variable named TotalColorList. Initialize it with the
empty string.
__ 10. Create a VarChar(255) stage variable named CurrentColorList. Initialize it with the
empty string.
__ 11. For the derivation for IsLastInGroup, use the LastRowInGroup() function on the
Item column to determine if the current row is the last in the current group of Items.
If so, return Y' (meaning Yes); else return N'.
__ 12. For the derivation of TotalColorList, return the conjunction of the current color to
CurrentColorList when the last row in the group is being processed. Otherwise,
return the empty string.
__ 13. For the derivation of CurrentColorList, return the conjunction of the current color to
the CurrentColorList when the last row in the group is not being processed. When
the last row is being processed, return the empty string.
Copyright IBM Corp. 2012 Exercise 17. Group processing in the Transformer 17-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 14. Drag the TotalColorList stage variable down to the cell next to Colors in the target
link.
__ 15. Define a constraint for the target link. Add text Is LastInGroup = 'Y' to output a row
when the last row in the group is being processed.
17-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 17. Edit the target Sequential File stage. Write to a file named ColorMappings2.txt in
your lab files Temp directory..
__ 18. Compile and run your job. Check the job log for error messages.
Copyright IBM Corp. 2012 Exercise 17. Group processing in the Transformer 17-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 19. View the data in your target stage. For each set of Item rows in the input file, you
should have a single row in the target file followed by a comma-delimited list of its
colors.
17-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 4. For its derivation invoke the SaveInputRecord() function, found in the Utility folder.
This saves a copy of the row into the Transformer stage queue.
__ 5. Define the loop condition. Iterate through the saved rows after the last row in the
group is reached.
Copyright IBM Corp. 2012 Exercise 17. Group processing in the Transformer 17-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 7. For its derivation invoke the GetSavedInputRecord() function in the Utility folder.
This retrieves a copy of the row from the Transformer stage queue.
__ 8. Drag the Color column across from the input link to the target output link. Put the
column second in the list of output columns.
__ 9. Remove the output link constraint.
__ 10. Compile and run. Check the job log for errors. View the data in the output.
17-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Note
If you do not have a working copy of the TransSellingGroupOtherwise job, import the
TransSellingGroupOtherwise.dsx job in your lab files dsxfiles directory.
__ 2. Open up your source stage. Set the stage to read from the
Selling_Group_Mapping_Debug.txt file.
__ 3. Create a job parameter named Channel. Make it a string with a default value of
Food Service, with the quotes.
__ 4. In the Transformer, open up the Constraints window. Add to the LowCode and
HighCode constraints the condition that the Distribution_Channel_Description
column value matches the Channel parameter value.
Copyright IBM Corp. 2012 Exercise 17. Group processing in the Transformer 17-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
17-12 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 8. Select the RangeErrors link and then click the Edit Breakpoints icon in the Debug
window. Set the breakpoint Expression to break when
Distribution_Channel_Description equals Food Service.
__ 9. Similarly, set the LowCode and HighCode link, breakpoint expressions to break
when Distribution_Channel_Description does not equal Food Service.
__ 10. Click the Start/Continue icon in the Debug window. When prompted for the job
parameter value, accept the default and click OK.
__ 11. Notice that the debugger stops at the RangeErrors link. The column values are
displayed in the Debug window. Click on the Node 1 and Node 2 tabs to view both
the data values for both nodes. Notice that each seems to have the correct value in
the Distribution_Channel_Description column. And the Special_Handling_Code
Copyright IBM Corp. 2012 Exercise 17. Group processing in the Transformer 17-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
is not out of range. So why are these values going out the otherwise link instead of
down the Lowcode link?
17-14 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 13. Click Run to End in the Debug window to see where the other rows go. The job
finishes and all the rows go down the otherwise link. But why? This should not
happen.
Copyright IBM Corp. 2012 Exercise 17. Group processing in the Transformer 17-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 14. Click the Start/Continue icon in the Debug window to start the job again. This time,
remove the quotes from around Food Service when prompted for the job
parameter value.
__ 15. Things definitely look better this time. More rows have gone down the LowCode link
and the breakpoint for the LowCode link has not been activated. The breakpoint for
the otherwise link has been activated. Since the Special_Handling_Code value is
out of range, this is as things should be.
__ 16. Click the Run to End icon in the Debug window to continue the job. This time the
job completes.
17-16 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 17. View the data in the LowCode file to verify that it contains only Food Service rows.
__ 18. View the data in the RangeErrors file to verify that it does not contain any Food
Service rows that are not out of range. There appear to be several Food Service
rows that should have gone out the LowCodes link.
__ 19. See if you can fix the bugs left in the job.
Hint
Copyright IBM Corp. 2012 Exercise 17. Group processing in the Transformer 17-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
17-18 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
This exercise covers Repository functionality in DataStage. In this
exercise you will try out these new features including, Repository
Search, Impact Analysis, and generating job and table difference
reports.
Requirements
The screenshots and the results you get will vary unless you have
completed all the previous exercises in this course. If you have not, in
most cases you will still be able to complete the tasks although your
results might differ somewhat.
Note
18-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
7. Select the found items and then click the right mouse button over them. Export
these jobs to a file named LookupJobs.dsx in your lab files Temp folder.
8. Close the Repository Export window.
10. Explore some of the graphical tools. Expand the graphic. Move the graphic
around by holding down the right mouse button over the graphic and dragging it.
Drag the graphic around by moving the icon in the Bird's Eye view window.
Explore.
18-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
2. If necessary, use the Zoom control to adjust the size of the dependency path so
that it fits into the window.
3. Hold your right mouse button over a graphical object and move the path around.
4. Close the Advanced Search window.
18-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
18-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
18-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
In this exercise you will first create a job that creates and loads a DB2
table using the DB2 Connector stage. In a later task you will read from
the table using the ODBC Connector stage.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 19. Reading and writing to relational tables 19-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Double-click on the Data Connection icon to display the Data Connection window.
__ 4. Name the data connection DB2_Connect_dsadm.
19-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 5. Click on the Parameters tab. Select the DB2 Connector stage type in the Connect
using Stage Type list.
Copyright IBM Corp. 2012 Exercise 19. Reading and writing to relational tables 19-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Task: Create and load a DB2 table using the DB2 Connector
stage
__ 1. Create a new parallel job named relWarehouseItems. The source stage is a
Sequential File stage. The target stage is a DB2 Connector stage. Name the links
and stages as shown.
__ 2. Edit the Warehouse Sequential File stage to read data from the Warehouse.txt file.
Be sure you can view the data.
__ 3. Edit the DB2 Connector stage as shown. First load the connection properties from
the Data Connection object you created in the previous task. This sets the
Database property to SAMPLE, and sets the user name and password properties.
19-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty In addition, set the Write mode property to Insert. Set Generate SQL to Yes. The
Table name is DSADM.ITEMS.
__ 4. Scroll down and set the Table action property to Replace. Also change the number
of rows per transaction (Record count) to 1. When this is done you must also set
Copyright IBM Corp. 2012 Exercise 19. Reading and writing to relational tables 19-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
the array size to 1 (because the number of rows per transaction must be a multiple
of the array size).
19-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 4. Click OK.
__ 5. Specify the To folder to point to your _Training>Metadata folder. Select the
DSADM.ITEMS table.
Copyright IBM Corp. 2012 Exercise 19. Reading and writing to relational tables 19-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Hint
If you have trouble finding it, type DSADM.ITEMS in the Name Contains box and then
click Refresh.
__ 6. Click Import.
__ 7. Open up your DSADM.ITEMS table definition in the Repository window and then
click the Columns tab to examine its column definitions.
__ 8. Click on the Locator tab and examine its contents. Verify that the Creator and
Table fields are filled in as shown. Type EDSERVER in the Computer box. This
19-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty metadata is saved in the Repository with the table definition and is used by
Information Server tools and components, including SQL Builder.
Copyright IBM Corp. 2012 Exercise 19. Reading and writing to relational tables 19-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
Task: Create a job that reads from a DB2 table using the ODBC
Connector stage
__ 1. Create a new job named relReadTable_odbc. Here, use the ODBC Connector
stage to read from the ITEMS table you created in an earlier task. Write to a Data
Set stage.
__ 2. Open up the ITEMS Connector stage to the Properties tab. Type SAMPLE in the
Data source box. Specify your database user name and password, here
dsadm/dsadm. Click Test to test the connection.
__ 3. Set the Generate SQL property to Yes.
19-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Copyright IBM Corp. 2012 Exercise 19. Reading and writing to relational tables 19-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. On the Properties tab, verify that you can view the data.
__ 7. In the Transformer stage map all columns across.
__ 8. In the target Data Set stage, write to a file named ITEMS.ds in your Temp directory.
19-12 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 9. Compile and run your job. Check the job log for errors. Be sure you can view the
data in the target data set file.
Copyright IBM Corp. 2012 Exercise 19. Reading and writing to relational tables 19-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
19-14 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
Multiple input links are a major new feature in DataStage. The links
can be used to update multiple relational tables within the same
transaction. The use of Connector stage Reject links is also
demonstrated in this exercise.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 20. Connector stages with multiple input links 20-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. Open the source Sequential File stage. Edit it so that it reads from the
Selling_Group_Mapping.txt file. Be sure you can view the data.
20-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 5. Open up the DB2 Connector stage. Click on the Stage tab at the top left. This
displays the Connection properties.
Copyright IBM Corp. 2012 Exercise 20. Connector stages with multiple input links 20-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. Click the Load link. Select the DB2_Connect_dsadm Data Connection object you
created in an earlier lab.
20-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 7. Click on the Input tab. Select the SGM_DESC input link in the Input name
(upstream stage) box at the top left of the stage. Set the Write mode property to
Insert, Set Generate SQL to Yes, and Table name to SGM_DESC as shown.
__ 8. Select the Table action cell. Click on the icon to the right of the parameter value
cell. Click New Parameter.
__ 9. Create a new job parameter named TableAction with a default value of Append.
Copyright IBM Corp. 2012 Exercise 20. Connector stages with multiple input links 20-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 10. Click OK. This adds the job parameter enclosed in pound signs (#).
__ 11. Click the Columns tab. Select the Key box next to the Selling_Group_Code box.
This will define the column as a key column when the table is created.
20-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 12. Select the SGM_CODES input link in the Input name (upstream stage) box at the
top left of the stage. In the Properties tab, set the Write mode property to Insert,
the Generate SQL property to Yes, the Table name property to SGM_CODES, and
Table action to #TableAction# as shown.
__ 13. Click the Columns tab. Select the Key box next to the Selling_Group_Code box.
This will define the column as a key column when the table is created.
Copyright IBM Corp. 2012 Exercise 20. Connector stages with multiple input links 20-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
down list. Select SGM_DESC in the Reject From Link box. Select the SQL error,
ERRORCODE, and ERRORTEXT boxes.
20-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Copyright IBM Corp. 2012 Exercise 20. Connector stages with multiple input links 20-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 18. Click the Run button. The Job Run Options window is displayed. The first time you
run this job, select Create as the Table action, so that the target tables get created.
__ 19. View the job log. Notice the DB2 Connector stage messages that display information
about the numbers of rows inserted and rejected.
__ 20. In the log, open the message that describes the statement used to generate the
table. Notice that the CREATE TABLE statement includes the PRIMARY KEY
option.
20-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 21. Now, let us test the reject links. Run the job again, this time selecting a Table action
of Append.
__ 22. Notice that all the rows are rejected, because they have duplicate keys.
Copyright IBM Corp. 2012 Exercise 20. Connector stages with multiple input links 20-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 23. In the job log, open up one of the reject Peek messages and view the information it
contains. Notice that it contains two additional columns of information
(RejectERRORCODE, RejectERRORTEXT) that contains SQL error information.
20-12 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
In DataStage SQL Builder is available in all Connector stages. You can
use it to construct SQL statements for reading and writing within a GUI
tool.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 21. Construct an SQL statement using SQL Builder 21-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 2. Open up your DSADM.ITEMS table definition. Click on the Locator tab. Edit or
verify that the Creator and Table boxes contain the correct schema name (creator)
and table name, respectively.
__ 3. Open up the Job Properties window and create two job parameters:
WarehouseLow is an integer type with a default value of 0. WarehouseHigh the
same type but has a default value of 999999
21-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 4. Open up the Connector source stage. In the Usage folder, set the Generate SQL
property to No. Notice that the warning icon shows up next to the Select statement
property.
__ 5. Click the Select statement cell and then click the Tools button. Click Build new
SQL (ODBC 3.52 extended syntax). This opens the SQL Builder window.
__ 6. Drag your DSADM.ITEMS table definition onto the canvas.
__ 7. Select all the columns except ALLOCATED and HARDALLOCATED and drag them
to the Select columns window.
Copyright IBM Corp. 2012 Exercise 21. Construct an SQL statement using SQL Builder 21-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 8. Sort by ITEM and WAREHOUSE in that order, ascending. To accomplish this select
Ascending in the Sort column. Specify the sort order in the last column.
__ 9. Click the SQL tab at the bottom of the window to view the SQL based on your
specifications so far.
__ 10. Click OK to save and close your SQL statement. You may get some warning
messages. Click Yes to accept the SQL as generated and allow DataStage to
merge the SQL Builder selected columns with the columns on the Columns tab.
21-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 11. In the Connector stage click the Columns tab. Ensure that the ALLOCATED and
HARDALLOCATED columns are removed, since they are not referenced in the
SQL.
__ 12. Click the Properties tab. Notice that the SQL statement you created using SQL
Builder has been put into the Select statement property.
__ 13. Open up the Transformer. Remove the output columns in red, since they are no
longer used.
__ 14. Compile and run. View the job log.
__ 15. Verify that you can view the data in the target stage.
Copyright IBM Corp. 2012 Exercise 21. Construct an SQL statement using SQL Builder 21-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 6. Click OK.
__ 7. For the new calculated column, specify a column alias of SHORT_ITEM.
21-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 10. Click the SQL tab at the bottom of the SQL Builder to view the constructed SQL.
Verify that it is correct.
__ 11. Click OK to return to the Properties tab. A message is displayed informing you that
your columns in the stage do not match columns in the SQL statement. Click Yes to
add the SHORT_ITEM column to your metadata.
__ 12. On the Columns tab, specify the correct type for the SHORT_ITEM column, namely
Varchar(15).
Copyright IBM Corp. 2012 Exercise 21. Construct an SQL statement using SQL Builder 21-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 13. Open the Transformer and map the new SHORT_ITEM column across. Remove the
ONHAND and ONORDER columns from the output.
21-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
Introduction
Sequence jobs are master jobs that run batches of DataStage jobs,
including other Job Sequences.
Requirements
No new requirements.
Copyright IBM Corp. 2012 Exercise 22. Build and run a Sequence job 22-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 3. Right-click over seqJob2 in the Repository window. Click Multiple Job Compile.
The DataStage Compilation Wizard window is opened. Add seqJob2 and
seqJob3 to the Selected items window.
22-2 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 4. Click Next two times to move to the Compile Process window.
__ 5. Click Start Compile. After the jobs compile successfully, click Finish.
__ 6. Return to the open seqJob1 canvas. Click the Parameters tab in the Job
Properties window, and note the parameters defined for seqJob1. The other jobs
have similar parameters.
Copyright IBM Corp. 2012 Exercise 22. Build and run a Sequence job 22-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 7. Open the Transformer. Notice that the job parameter PeekHeading prefixes the
column of data that will be written to the job log using the Peek stage.
22-4 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
EXempty __ 11. Open the General tab in the Job Properties window. Read and check all the
compilation options.
__ 12. Add job parameters to the job sequence to supply values to the job parameters in
the jobs. Click on the Add Environment Variable button and then add
$APT_DUMP_SCORE. Also add three numbered RecCount variables:
RecCount1, RecCount2, and RecCount3. All are type string with a default value of
10.
__ 13. Open up each of the Job Activity stages and set or verify that the Job name box is
set to the job the Activity stage is to run.
__ 14. For each Job Activity stage, set the job parameters to the corresponding job
parameters of the job sequence. For the PeekHeading value use a string with a
single space.
Copyright IBM Corp. 2012 Exercise 22. Build and run a Sequence job 22-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 15. Set the Execution action to Reset if required, then run. Shown below is the
seqJob1 Activity stage. The others are similar.
__ 16. In each of the first two Job Activity stages, set the job triggers so that later jobs only
run if earlier jobs run without errors, although possibly with warnings.
This means that the DSJS.JOBSTATUS is either DSJS.RUNOK or
DSJS.RUNWARN.
To do this, create a custom trigger such that the previous job's status is
equal to one of the above two values. Click the right mouse button in the
expression window to insert the $JobStatus Activity Variable.
22-6 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 2. Open the User Variables stage to the User Variables tab. Right-click in the window
and then click Add Row. Create a user variable named varMessagePrefix.
__ 3. Double-click in the Expression cell to open the Expression Editor. Concatenate the
string constant Date is with the DSJobStartDate DSMacro, followed by a bar
surrounded with spaces ( | ).
Copyright IBM Corp. 2012 Exercise 22. Build and run a Sequence job 22-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Open each Job Activity stage. For each PeekHeading parameter, insert the
varMessagePrefix in the Value Expression cell.
__ 5. Compile and run. In Director, open the job log for the seqJob1 job. Verify that the
PeekHeading value is inserted before the column values in the Peek messages in
the log. Below we see that the heading (Date is...) prefixes the data
(bbbbbbbb) going into col1.
22-8 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 3. Add a job parameter named StartFile to pass the name of the file to wait for.
Copyright IBM Corp. 2012 Exercise 22. Build and run a Sequence job 22-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Edit the Wait for File stage. Specify that the job is to wait forever until the
#StartFile# file appears in the DSEss_Files>Temp directory.
__ 7. Now open the seqStartSequence job that was part of the seqJobs.dsx file that
you imported earlier. This job creates the StartRun.txt file in your
DSEss_Files/Temp directory.
__ 8. Compile and run the seqStartSequence job to create the StartRun.txt file. Then
return to the log for your sequence to watch the sequence continue to the end.
22-10 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
Student Exercises
__ 3. Edit the Terminator stage so that any running jobs are stopped when an exception
occurs.
Copyright IBM Corp. 2012 Exercise 22. Build and run a Sequence job 22-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
__ 4. Compile and run your job. To test that it handles exceptions make an Activity fail. For
example, set the RecCount3 parameter to -10. Then go to the job log and open the
Summary message. Verify that the Terminator stage was executed.
22-12 IBM InfoSphere DataStage Essentials v9.1 Copyright IBM Corp. 2012
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0.1
backpg
Back page