Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Related Documentation
The Online Library, DK Online Library, and Resource Adapters
Online Library buttons on the title page of this document contain
links to the documentation for all Ascential DataStage TX products.
To learn more about documentation from other Ascential products as
they relate to the Design Studio, refer to the following table.
Guide Description
Design Studio Introduction Using the Design Studio client components to
define data content, define data
transformation, and perform business
process modeling. This is a companion book
to the Design Studio Tutorial.
Type Designer Reference Guide Using the Type Designer to create and edit
type trees that describe your data.
Map Designer Reference Guide Describing the Map Designer user interface
and providing instruction on specifying
mapping rules, configuring map sources and
targets, defining map-level settings, and
executing a compiled map.
Conventions
Convention Used for…
bold Field names, button names, menu items, and
keystrokes. Also used to indicate filenames, and
window and dialog box names.
user input Information that you need to enter as is.
code Code examples
variable Placeholders for information that you need to enter.
or Do not type the greater-/less-than brackets as part of
the variable.
<variable>
Contacting Support
To reach Customer Care, please refer to the information below:
Call toll-free: 1-866-INFONOW (1-866-463-6669)
Email: support@ascentialsoftware.com
Ascential Developer Net: http://developernet.ascential.com
Please consult your support agreement for the location and
availability of customer support personnel.
To find the location and telephone number of the nearest Ascential
Software office outside of North America, please visit the Ascential
Software Corporation website at http://www.ascentialsoftware.com.
Introduction
Design Studio Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Tutorial Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Help Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Menu Commands and Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Your Working Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Design Studio Tutorial Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Unzipping the Ch01.exe File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Design Studio Tutorial Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Chapter 1
Mapping Basics
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Files Used in This Chapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Files Provided for Chapter 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Files Created for Chapter 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Contact Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Label Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
Starting the Map Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Exploring the ContactToLabel Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
Chapter 2
Modifying the Contact Type Tree
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Files Provided for Chapter 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Files You Create or Modify for Chapter 2. . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
FullContact Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Label Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Starting the Type Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Exploring the Contact Type Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Type Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Viewing Type Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Properties of the Contact Group Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Components of Contact. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Classification Hierarchy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Adding a New Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Adding Components to Group Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Component Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Saving the Contact.mtt Type Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Chapter 3
Modifying the Mail.mss Map Source File
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Files Used in This Chapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Files Provided for Chapter 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Files You Create or Modify for Chapter 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Copying an Input Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Modifying the ContactToFullLabel Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
Creating the Label Output Card. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Editing the ContactFile Input Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Creating the Map Rule for Label(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
Executable and Functional Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
Functional Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
General Functional Map Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Label Map Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
Functional Map Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
Entering Map Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
Mapping to the Company Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
Data Object Name Reminder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
Viewing Map Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
Sizing the Rule Column and Output Column . . . . . . . . . . . . . . . . . . . . . . . 3-22
Mapping to the Street Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23
Mapping to CityStateZip Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23
Mapping to the FullName Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
Functions Used in Map Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
PRESENT Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
IF Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
Mapping the FullName Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
Mapping the Second Argument of the IF function . . . . . . . . . . . . . . . 3-28
Mapping the Third Argument of the IF function . . . . . . . . . . . . . . . . . 3-29
Saving the Mail.mms Map Source File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30
Building the ContactToFullLabel Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-31
Running the ContactToFullLabel Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-31
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-32
Viewing the ContactToFullLabel Map Run Results . . . . . . . . . . . . . . . . . . 3-32
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-34
Chapter 4
Using the UNIQUE Function
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Files Provided for Chapter 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Files You Create or Modify for Chapter 4. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Copying an Input Card to a New Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Copying an Input Card to an Output Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Editing a Card. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
Chapter 5
Using the EXTRACT Function
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Files Provided for Chapter 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Files You Create or Modify for Chapter 5. . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
Extracting Contacts for a Specific State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
Copying the ContactToFullLabel Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
Defining a New Input File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Defining a New Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
Entering a Map Rule to Extract Specific Records . . . . . . . . . . . . . . . . . . . . . . . 5-6
Card Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
Chapter 6
Using the OR Function With a Lookup File
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Files Provided for Chapter 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Files You Create or Modify for Chapter 6. . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Type Designer and Map Designer Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Using the Type Designer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
Using Type Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
Creating the Preferred Type Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
Chapter 7
Using Cross-Referenced Data
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
Files Used in This Chapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Files Provided for Chapter 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Files You Create or Modify for Chapter 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
Modifying the Customer.mtt Type Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
Field Item Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Region Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Record Group Type Represents Region Records . . . . . . . . . . . . . . . . . . . . 7-6
Properties of Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
Components of Record. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
RegionRecordsFile Group Type Represents the File . . . . . . . . . . . . . . . . . . 7-8
Properties of RegionRecordsFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
Component of RegionRecordsFile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
Save the Customer.mtt Type Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
Output Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
Using the Map Designer to Generate Region Reports . . . . . . . . . . . . . . . . . . 7-10
Creating the CreateRegionFile Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
Creating the RegionReport Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
Chapter 8
Using the CHOOSE Function
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
Files Provided for Chapter 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
Files You Create or Modify for Chapter 8. . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Generating the Congratulations Message File . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Raffle.mtt Type Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
PrizeRecord Group Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
PrizeFile Group Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
WinnerFile Group Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
CongratulationsRecord Group Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
CongratulationsFile Group Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Raffle Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
Chapter 9
Data Breaks By Object Count
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Files Provided for Chapter 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Files You Create or Modify for Chapter 9. . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Scenario – Counting Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
Merging the Contact Group Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
Adding a Component Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
Chapter 10
Data Breaks By Value
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1
Files Used in This Chapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Files Provided for Chapter 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Files You Create or Modify for Chapter 10 . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Scenario - Data Value Changes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
Control.mtt Type Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
Adding a Component Rule for Distinguishability . . . . . . . . . . . . . . . . . . . 10-4
Using Shorthand Notation in a Component Rule . . . . . . . . . . . . . . . . . . . 10-6
Data Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
Creating the MakeCountFile Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8
Chapter 11
Partitioning Types To Simplify Map Rules
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1
Files Used in This Chapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
Files Provided for Chapter 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
Files You Create or Modify for Chapter 11 . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
Partitioned Type Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4
Deliver.mtt Type tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5
Assigning the Identifier Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6
Entering Component Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7
Viewing Component Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9
Deliver Map Source File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11
OrdersByDept Executable Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-12
Generating the Acct.txt File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-12
Generating the Order.txt File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-13
ActivityReport Executable Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-14
Generating the Report.txt File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-15
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-17
Chapter 12
Mapping Optional Inputs
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1
Files Provided for Chapter 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1
Files You Create or Modify for Chapter 12. . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Input Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
States.mtt Type Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
Component Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4
Using the Map Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-10
Chapter 13
Mapping Multiple Files to One File
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
Files Provided for Chapter 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
Files You Create or Modify for Chapter 13. . . . . . . . . . . . . . . . . . . . . . . . . 13-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
Using Ellipses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
TwoFiles.mtt Type Tree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5
Input Detail Records. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5
Input Header Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-6
Output PO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-7
Using the Map Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-7
CreatePO Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-7
Generating the CreatePO Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-8
F_MakePO Functional Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-9
F_MakeDetail Functional Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-10
CreatePO Executable Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-10
Generating the PO.txt Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-11
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-11
Chapter 14
Detail Records Not Sorted by PO
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-1
Chapter 15
Creating a Trace File
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1
Files Used in This Chapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1
Files Provided for Chapter 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2
Files You Create or Modify for Chapter 15 . . . . . . . . . . . . . . . . . . . . . . . . . 15-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-3
Trace File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-3
Creating a Trace File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-4
Changing MapTrace Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-4
Viewing the Trace File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-5
Customer# Type Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-5
Floating the Trace File in the Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . 15-6
Data Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-6
Item Type Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-6
Group Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-8
Card Object Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-8
Final Trace Message. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-9
Invalid Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-9
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-9
Chapter 16
Exporting a Map
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-1
Chapter 17
Importing a Map
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-1
Files Provided for Chapter 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-1
Files You Create or Modify for Chapter 17. . . . . . . . . . . . . . . . . . . . . . . . . 17-2
Importing a Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-2
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-3
Chapter 18
Mapping Invalid Data
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-1
Files Provided for Chapter 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-2
Files You Create or Modify for Chapter 18. . . . . . . . . . . . . . . . . . . . . . . . . 18-2
CustomerErrors.mtt Type Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-3
Restart Attribute. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-4
Mapping Invalid Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-5
MyCustomers Executable Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-6
Generating the Error File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-6
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-7
Chapter 19
Incrementing Output Data
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-1
Files Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-1
Chapter 20
Creating a Validation Map
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-1
Files Used in This Chapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-1
Files Provided for Chapter 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-1
Files You Create or Modify for Chapter 20 . . . . . . . . . . . . . . . . . . . . . . . . . 20-2
Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-3
Creating a Validation Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-3
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-4
Index
Tutorial Objectives
Completing this tutorial will enable you to use the Design Studio
applications.
You will be able to:
Create and modify type trees and maps.
Use functions in map rules.
Include cross-referenced data in your maps.
Define breaks in data.
Create functional maps to process specific data transformation.
Create nested functional maps.
Use functions in map rules.
Use functions in component rules.
Associated related data.
Build business rules in your data transformation.
Create trace files.
Export a map.
Build a validation map.
Help Overview
The Design Studio’s extensive and versatile Help system provides you
with immediate assistance and reference information. There are
several ways to access Help while using the Design Studio.
To access Help
Choose one of the following access methods:
From the Help menu, choose Contents.
The complete Ascential DataStage TX Help system appears.
– Locate a topic in the contents.
– Click the Index tab to search by keyword.
– Click the Search tab to perform a text search.
Installation
This tutorial requires that the Design Studio applications be installed
on your system. Ascential DataStage TX products include a simple
installation program. The Design Studio applications are installed as
one of the components of the installation program. Refer to the
release notes for installation instructions.
The files required to use the exercises in this Design Studio Tutorial
are provided in the default Ascential DataStage TX installation
tutorial folder.
For the purposes of this document, it is assumed that the Design
Studio is installed in the default installation directory on drive C. The
tutorial files are provided as self-extracting zip files under the
exercises and solutions folders in the install_dir\tutorial folder.
Note <install_dir> refers to the directory where your product is
installed.
A single, self-extracting zip file (*.exe) is provided for each chapter.
In this exercise, you will open, build, and run a map in the Map
Designer. You will also examine the data structure of the input and
output files.
Objectives
This exercise introduces basic mapping skills used in the Map
Designer.
By completing the exercises for Chapter 1, you will learn how to:
Identify map file types and map file name extensions.
Open a map source file.
Select a map in the Navigator.
Expand and collapse maps in the Navigator.
Expand and collapse input and output cards in the Navigator.
Expand and collapse nested data objects on input and output
cards.
Identify map rules.
Resize, dock, and float the Rule Bar.
Build a map.
Run a map.
View the run results of a map.
Identify the link between the Type Designer and the Map Designer.
Map build analysis ContactToLabel.mme Map build analysis results file generated
results file from the build process
Backup type tree *.bak Backup type tree files and map source files
and map files created automatically during the Save
process
The default behavior is to create backup files with the .bak filename
extension when each type tree file or map source file is saved.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
You have a simple Contact.txt text file consisting of one record that
contains information about a customer. Using the file as input, you
need to generate a mailing label for this customer.
Contact Record
The Contact.txt file (the contents of which are shown below) is a
simple text file with one record containing information about a
customer. The record includes the name of the contact person at the
company, the company name, the address, and the phone number.
This input data must be described as a file (consisting of one contact
record), and as a record (consisting of multiple data fields).
In the Contact.mtt type tree:
The input data is a file that consists of a single contact record. The
data object that represents the file containing the contact record is
ContactFile.
The input data is also a contact record consisting of many data
fields delimited by commas. The data object that represents the
contact record is Contact.
The ContactFile group type represents the file that contains records
of contacts. Group types contain components. A component
represents a data object that is part of another data object. The
Contact group type is a component of the ContactFile group.
The ContactFile group represents the entire file of contact records.
The Contact group represents a contact record. Multiple contact
records may exist in the same file.
Label Record
The Label.txt output file you want to generate will consist of one
mailing label. The label consists of four data fields, each on a separate
line.
The components of the Label group type are defined in the Label
group window. Each component represents a portion of the Label
record. The Label group contains the components of the label record
in the order they appear in the data stream.
The Label.mtt type tree defines the data of the Label record, as
shown in the following illustration.
Each input and output card represents one data object, identified by
selecting a type from a type tree. A card may represent an object in a
row, a row in a record, the entire record, or the entire file.
Each card specifies a type tree and a type as part of the card definition.
This type, and the type tree that contains it, is the link between the
Type Designer and the Map Designer that defines the structure and
properties of the data in the card.
Input cards represent input data.
Output card represent output data and contains the map rules that
transform that data. Therefore, only the output card has a rule
column.
Each card specifies a name, a type tree and a type as part of the card
definition. The name of the input card can be anything. In this case,
the name of the input card is ContactFile, which describes the data
object it represents. Each card represents one data object, identified
by selecting a type from a type tree. The ContactFile input card
specifies the Contact.mtt type tree and the ContactFile Data type
(the ContactFile group type is a subtype of Data). This type, and the
type tree that contains it, is the link between the Type Designer and
the Map Designer that defines the structure and properties of the data
in the card.
The ContactFile input card contains the definition of the input for the
ContactToLabel map including information such as source
identification (Contact.txt file), retrieval specifics, and the behavior
that should occur during processing. The ContactFile input card
definition is shown below.
The Label output card defines how the output is generated. The
Target specifies the output be written to the File specified for the
FilePath setting. If a path is not specified for the FilePath, the map
source file location is used. The settings of the Label output card,
shown below, specify the output file Label.txt be written to the map
source file folder, in this case ..\tutorial\my_exercises\ch01.
The Label output card represents the Label group type. The Label
group contains the components that define the fields of the Label
record (such as Full Name, Company, and so on). Components are
listed from top to bottom in the order they appear in the data stream.
The structure of the output card defines the data in a compositional
hierarchy.
In the Navigator, map source files can be expanded to view all of the
maps they contain. Maps can be expanded to view the input and
output cards. Icons that display a plus sign (+) may be expanded.
Icons that display a minus sign (-) may be contracted.
In the List view of the Navigator, the ContactToLabel map can be
expanded to view the input and output cards.
Map Rules
Map rules are used in output cards of a map to define how output data
is built. Map rules are required for output data generation. If there is
no map rule, there is no output data.
Each output card has a rule column in which you enter map rules.
Each map rule begins with an equal sign (=), followed by an
expression.
A map rule is an expression that evaluates to data.
An expression is any valid combination of literals, data object
names, operators, functions, and map names.
The expression in a map rule generates the desired data. Map rules
are entered in the Rule Bar. Portions of the map rule are visible in the
rule cell on the output card.
You edit and view the map rule in the Rule Bar, which can be docked
or floated.
The default position of the Rule Bar is docked beneath the menu bar.
If the Rule Bar is not visible, you can view the Rule Bar. You can
resize, dock, or float the Rule Bar.
Results
If no errors occur, executing the Build command generates the
following files in the same folder as the map source file:
ContactToLabel.mmc (compiled map file)
ContactToLabel.mme (map build analysis results file)
Build results of a map provide information on errors and warnings
that occur during the map build process. Use Windows Explorer to
view the files generated during the build process.
Results
Executing the Run command generates the Label.txt output text file.
3 Click OK. Each data source and target appears in its own window.
Tip To quickly view all run results of a map, press Ctrl + Shift
and click (View run results).
The position of the run results windows is retained for each map. The
next time the run results are viewed, the run results windows appear
in the same position. The mapname.mopt file contains map-specific
options. The .mopt file is created in the map folder when the map is
saved.
You can close multiple data windows at once.
Summary
The Mail.mms map source file contains the ContactToLabel map.
Input cards define the source of the map. Output cards define the
target of the map.
The Label group window The Label output card definition specifies the
contains the components of Label.mtt type tree and the Label Data
the Label record in the order type.
they appear in the data The Label type defines the structure and
stream. properties of the data in the card.
The specification of the Label type and the
Label.mtt type tree that contains it is the link
between the Type Designer and the Map
Designer that defines the structure and
properties of the data in the card.
Objectives
This exercise modifies an existing type tree and introduces
component ranges.
By completing the exercises for Chapter 2, you will learn how to use
the Type Designer to:
View and understand type properties.
View associated input data file.
Open and close group windows components.
Modify a type tree to create a new data field.
Add a component to a group type.
Add a component range to an optional component.
Access Help for a field in a dialog.
Analyze and save a type tree.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
You have a Contact text file consisting of multiple records that
contain information about a customer.
Using the file of multiple records as input, you need to generate one
mailing label for each contact record in the input data. The input data
contains optional data objects; the records of some customers contain
middle names or initials.
You need to modify the type tree that represents the input data to
contain a middle name field.
FullContact Record
The FullContact.txt file is a file of an unknown number of records
that contain information about customers. The records include the
name of the contact person at the company, the company name, the
address, and the phone number. The middle name is optional.
Use any text editor to view the FullContact.txt text input data file.
This input data can be described as a file consisting of multiple
contact records with each contact record consisting of many data
fields.
Label Output
The output data is a file of mailing labels. We want to generate one
label for every contact record in the input. The labels will consist of
four data fields, each on a separate line.
The labels should look like the following:
James P. Adams
ABC Co.
29 Frankford Rd
Bloomington, IL 60525
Maria B. Miller
Conrad Corp
1234 Smith St
Buffalo Grove, CA 60089
Fred A. Smith
Sand Inc.
Beach Street
Pismo Beach, FL 33321
Type Properties
The properties and definitions of all data objects are defined in the
type tree. The properties and definition of each data object in the input
data, and each data object in the output data, must be defined in a
type tree to achieve the desired data transformation. In the type tree
window, the color of the icon in the type tree provides a visual
indication for the Class of the data object.
Category icons are red.
Group icons are green.
Item icons are blue.
Components of Contact
The Contact group window defines the components of the Contact
input data. The components of the Contact group type define the
data objects for the contact records in the order they appear in the
data stream.
In the Contact group window composition hierarchy shown below,
there is not a data definition for the Middle Name Field.
Classification Hierarchy
The classification hierarchy shown in the Contact.mtt type tree
window illustrates that the First and Last item types are subtypes of
Name. The Name item type is a subtype of the Field item type. We
could also express this classification hierarchy by saying that First
Name and Last Name are subtypes of Field. Two type names
separated by a space, such as First Name, indicate a classification
subtype relationship.
3 Click Yes.
A new type is added as a subtype of Name. The new type is
highlighted in the type tree with the default name NewType1.
4 In the type tree window, enter Middle as the name of the new
type.
5 Press Enter.
The new type name Middle appears and the Name type is
selected. The Properties window, displaying the properties of
Name, also appears.
3 Click the plus sign (+) to expand the Item Subclass property.
4 Expand the Size (content) property.
The size of an item includes separators and signs, but not initiator,
terminator, release, or pad characters. The Min property defines the
minimum number of bytes of the item. The Middle Name Field has a
minimum size of 1 byte.
The Min value of 1 was inherited from the Name type. The property
was inherited from the selected Name type when the Middle type
was created as a subtype of Name.
Tip For information on the values for specific type properties,
access Help on any type property by right-clicking the
property in the Properties window and selecting Help
from the context menu.
Component Ranges
The component range of a data object defines the number of
consecutive occurrences of that component. If a component range is
other than the default (1:1), it appears in the group window after the
component name in parenthesis.
The component rule bar appears on group and category windows.
The component rule bar is used to specify the component range and
component rules for the selected component in the window. You can
enter text in the component rule bar or drag objects from type trees
into component rules. For detailed information on component rules,
see the Type Designer Reference Guide.
The Middle Name Field is an optional component. Optional
components must have 0 as the minimum component range value.
The range for Middle Name Field is (0:1), indicating a minimum of
zero occurrences and a maximum of one occurrence.
4 Click OK.
The optional component range of (0:1) appears next to Middle
Name Field.
5 Close the Contact Data group window to save the addition of the
Middle component.
6 When prompted for confirmation, click Yes to save changes.
2 Click Close.
3 From the File menu, choose Save.
Summary
The contact records for each customer may include a middle name.
The data object that represents the middle name must be defined in
the Contact.mtt type tree. The data object that represents the middle
name field already exists in the Label.mtt type tree as the FullName
Field. The map rule for FullName Field provides the logic for
building the FullName on output.
The Contact.mtt type tree was modified to add the Middle item
type.
Objectives
This exercise copies an input card to create a new map, and
introduces map rules and functions.
By completing the exercises for Chapter 3, you will learn how to use
the Map Designer to:
Copy an existing card to a new map.
Create an output card.
Use the What's This Help.
Create a functional map using the Functional Map Wizard.
Enter and edit map rules.
Use the IF function to evaluate a conditional expression.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this tutorial.
Scenario
You have a file that consists of multiple records containing
information about your customers. This source data is the
FullContact.txt text file.
The FullContact.txt file of records contains optional data objects;
the records of some customers contain middle names or middle
initials. Using the FullContact.txt file of multiple records as input,
you want to generate one mailing label for each contact record in the
input data.
The data object on the Label output card in the ContactToLabel
map represents a single label. The value of the Type Name on this
Label output card is Label. The Label group type represents a single
label.
The output card Type Name must be changed to the data object that
represents the output file of label records. The data object that
represents the entire file of label records is LabelFile.
The map rules on the Label output card specify the logic for
generating the mailing labels. These map rules must be modified to
conditionally include the middle name or initial in the generated
mailing labels.
To copy the ContactFile input card to a new map start the Map
Designer
1 From the Windows Start menu, choose Programs.
2 Choose Ascential DataStage TX n.n > Design Studio > Map
Designer, where n.n represents the version number.
The Startup dialog appears with the default startup option Open
an existing map source file selected.
3 Click OK.
The Open dialog appears.
4 Navigate to your Chapter 3 working folder:
..\tutorial\my_exercises\ch03.
5 Select the Mail.mms map file and click Open.
6 In the Navigator, select the #1 ContactFile input card in the
ContactToLabel map.
7 From the Card menu, choose Copy.
The Copy Card dialog appears.
8 For the Into fields:
– Leave Mail.mms in the File field.
– Enter ContactToFullLabel for the Map field.
Note Copying a card to a new map automatically copies the
input card and generates the new map at the same time.
The ContactToFullLabel map does not exist, so it will
be created.
Note The Label data object has a component range of (s), which
indicates some unknown number of Labels. The
component range of (s) appears on cards next to the type
name.
Functional Maps
A functional map is like a sub-routine; it maps a portion of data at a
time. A functional map takes one or more input objects and generates
one output object.
The use of functional maps is very common. Almost every executable
map created will use at least one functional map. A functional map
and the executable map that calls it must be in the same map source
file (.mms).
To map a group in the input to a different group in the output, use a
functional map. The presence of an output component with a range of
more than one is one determining factor of when to use a functional
map.
Note The Label data object component range of (s) indicates the
number of Label(s) to be created is based on the number of
Contact(s).
Another important factor in determining when to use a functional map
is when you want to transform the data: mapping from one or more
types to a different type.
For the ContactToFullLabel map, we want to map from the First
Name Field, Middle Name Field, and Last Name Field to the
FullName Field.
We know we need to use a functional map because:
The number of a certain output group, Label, that we want to
create is based on the occurrences of some input data, Contact.
The types are different types (First Name Field, Middle Name
Field, and Last Name Field to FullName Field).
specifies:
F_MakeLabels is the name of the functional map.
The input data object is Contact, which is a component of
ContactFile.
3 Select the Out output card and click the Edit button.
5 Click OK to close the Card Attributes dialog for the output card.
6 Edit the input card and assign a meaningful name: ContactsIn.
The green face icon ( ) indicates successful functional map type
tree and type selections.
Note Placing the curser on the Tree name will show you with the
entire tree file path.
7 Click Create.
The F_MakeLabels functional map is created. The contents of the
Functional Map Wizard dialog are automatically cleared after a
functional map is successfully created.
8 Click Close.
On the Composition tab of the Navigator, functional maps appear
underneath the executable map that calls it.
4 Place current focus in the Rule Bar or the rule cell and press
Enter to commit the map rule.
Note When dragging a data object into a rule cell, the equal sign
is automatically inserted.
A comma and a space should appear between the city and state, and
another space should appear between the state and zip code. The
CityStateZip Field should look like this:
Bloomington, IL 60525
Note Syntax errors in the Rule Bar are indicated with underlines.
While the map rule is under construction it is normal to see
underlines.
PRESENT Function
The PRESENT function checks for the presence of an object. If the
object is present, the function returns TRUE. If the object is not
present, the function returns FALSE. The syntax of the PRESENT
function is:
PRESENT (object_to_look_for)
IF Function
This function evaluates a conditional expression, returning one value
if true, another if false.
There are three arguments in the IF function. The first argument is a
condition. If it is TRUE, the second argument is performed. If it is
FALSE, the third argument is performed. The syntax of the IF function
is:
IF (test_this, result_if_true [, result_if_false])
Tip Placing current focus in the Functions list and typing the
letter I jumps directly to the I functions.
4 Click Insert.
=IF( ) appears in the Rule Bar. The cursor is positioned
between the parentheses, ready for the first argument of the
function.
5 Click Close to close the Insert Function dialog.
6 To make the rule easier to read, enter a few spaces after the
opening parenthesis (.
7 Insert the PRESENT function and close the Insert Function dialog.
=IF( PRESENT( ) ) appears in the Rule Bar. The cursor is
positioned between the parentheses, ready for the first argument
of the PRESENT function.
8 To improve readability, type a few spaces next to the PRESENT
function, before the opening parenthesis (.
9 Drag the Middle Name Field from the ContactsIn input card
into the Rule Bar, between the parentheses of the PRESENT
function.
10 After the ending parenthesis of the PRESENT function, type a
comma (,) and a space.
Results
Executing the Map > Run command generates the FullLabel.txt
output text file.
4 Click OK.
The results window for the #1 LabelFile output card on the
ContactToFullLabel map appears. Note that the middle initials
appear in the output file where needed, and that Mary Jones of
McCormick Enterprises has no middle name.
Check the output results in the Map Designer and in the destination
directory using Explorer.
Summary
The Mail.mms map source file contains the original
ContactToLabel map.
You copied this ContactToLabel map to create a new map
named ContactToFullLabel.
The ContactToFullLabel map has the same cards as the
ContactToLabel map.
You edited the #1 LabelFile output card so the data object
represented by this card is the entire file of labels: the LabelFile
group type.
The Label group type is a component of LabelFile.
You created a map rule that called the F_MakeLabels functional
map.
You used the Functional Map Wizard to automatically create a
functional map.
– The map rules to generate labels with an optional middle name
were entered on the objects on the output card of the
functional map. These map rules used the IF and the PRESENT
functions.
The rules on the #1 LabelFile output card became unresolved due to
the difference in data structure. The unresolved rules appear
automatically on the Organizer window on the Unresolved Rules
tab. These may be reused if needed, but you deleted them and
redefined the required map rules on a functional map.
Objectives
This exercise copies and modifies an existing map, and introduces the
UNIQUE function.
By completing the exercises for Chapter 4, you will learn how to:
Modify an existing map.
Copy an input card to create a new map.
Copy an input card to an output card.
Edit card settings.
Use the UNIQUE function to avoid creating duplicate records.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
The FullContact.txt file that contains your customer records
contains duplicate records. You must generate an output file that
contains only the unique contact records.
The output file containing only the unique records can then be used as
the input file to generate the label file.
4 Click OK.
The UniqueContacts map is created with the ContactFile input
card.
4 Click Yes to confirm that you want to copy the card as an output
card.
A new card appears in the Navigator under Output Cards
named #1 ContactFile_1.
Editing a Card
The newly created #1 ContactFile_1 output card should be renamed
to represent the output it generates. In the Edit Output Card dialog,
change the setting to direct the output of the UniqueLabels map to a
text file named unique.txt.
5 Click OK.
When the data objects are expanded on the ContactFile input card
and the UniqueContactsFile output card, the cards should look like
this:
In this map, you want to map only the unique contact records. Use the
UNIQUE function, which evaluates a series of objects, belonging to
some type.
The UNIQUE function returns the unique data objects in that series.
The syntax of the UNIQUE function is:
UNIQUE (series_whose_unique_objects_you_want)
Summary
The Mail.mms map source file now contains three executable maps
and one functional map.
Objectives
This exercise modifies an existing map and introduces the EXTRACT
function.
By completing the exercises for Chapter 5, you will learn how to:
Modify an existing map.
Use the right-click context menu to edit a card.
Use the EXTRACT function to extract data for which a specified
condition is true.
Copy a map.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
From the FullContact.txt input file, you need to generate a list of
labels for the Florida addresses only.
4 Click OK.
The FloridaLabels map appears in the Navigator.
Tip The input file is defined by the value of the Source >
FilePath setting on the ContactFile input card.
Note Map rule syntax requires a close parenthesis for every open
parenthesis.
9 Press Enter to commit the map rule.
With a floated Rule Bar, the map should look like this:
Summary
The Mail.mms map source file now contains the FloridaLabels
executable map.
The FloridaLabels executable map was created as a copy of the
ContactToFullLabel map.
You changed the source of the input card. You defined a new target for
the output card. You defined a map rule to extract the contact records
for Florida addresses.
The FloridaLabels.txt file was generated with two Florida addresses.
Note Close all maps, type trees, and text files.
You need to generate labels for only the preferred customers in the
address file.
Objectives
This exercise introduces creating type trees and the concept of
creating a lookup file.
By completing the exercises for Chapter 6, you will learn how to:
Create a type tree that represents preferred customers.
Change type properties in the Properties window.
Use type inheritance for creating subtypes.
Define group types as Explicit or Implicit.
Define terminators and delimiters.
Index the output object to generate a specific number of
occurrences.
Use the TODATETIME function to convert a text literal to a date
format.
Generate a lookup file of preferred customers as output of a map.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
You need to create a file containing the names of preferred customers.
You can then use this lookup file to determine whether a contact is a
preferred customer, and generate labels for preferred customers only.
The data structure of this lookup file must be defined in a type tree.
The type tree for the lookup file must have item types for:
Company Field
ID Field
PurchaseDate Field
The type tree for the lookup file must have the following group types:
Customer - represents customer records
PreferredFile - represents the file containing customer records
ID Text Character 0
Next, create the group types. Generally, the order in which types are
created does not matter. For this tutorial, however, please follow these
steps.
Create the group types Customer and PreferredFile.
The Customer group type represents the contact records.
The PreferredFile group type represents the file that contains
these records.
To create the Customer group type
1 From the Type menu, choose Add.
The confirmation dialog appears.
5 Change the Class to Group by selecting the Group class from the
Class drop-down list.
The confirmation dialog appears.
3 Click OK.
3 For the Delimiter > Value, enter the literal forward and backward
slashes /\.
Note The literal delimiter text does not require quotation marks.
3 Click OK.
The range (s) appears after the Customer component name.
MakePreferredData Map
You have created the Preferred.mtt type tree to describe the
preferred customer data. Now you must create, build, and run a map
to generate that data.
The Mail.mms map source file is provided. You can easily add
another map to this map source file.
The map rule for the first occurrence of the PurchaseDate Field
is:
=TODATETIME ("010322","yymmdd")
Summary
You created the MakePreferredData map to generate the
lookup.txt file. You modified the ContactToFullLabel map by
adding an input card to use the preferred.txt, changing the filename
of the output file.
The call for the functional map uses the OR function and the EXTRACT
function to generate a list of labels for preferred customers only.
Objectives
This chapter defines how to cross-reference data from another source
and incorporate it into the output.
By completing the exercises for Chapter 7, you will learn how to:
Create group types to represent records.
Create group types to represent files of records.
Add components to group types.
Define component ranges.
Use the LOOKUP function to locate an object in a list that is not
organized in any particular order.
Use the SORTDOWN function to locate an object in a list that is in
descending order.
Use the SEARCHUP function to locate an object in a list that is in
ascending order.
[Optional] Use the SORTUP function to locate an object in a list that
is in ascending order.
[Optional] Use the SEARCHDOWN function to locate an object in a
list that is in descending order.
Backup type *.bak Backup type tree files and map source files
tree and map are created automatically during the Save
files process
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
You have the unique.txt file of unique contacts. This data is not in
any particular sequence. The geographical region information is not
contained in this input file.
You need to generate a cross-reference region.txt file that contains
records identifying the name of each customer contact, their
company, and their geographical region.
You need to generate the regionreport.txt file that contains the
contact name, company name, and the region.
Region Data
The data is a file you will generate as an output of the Customer
map. You want to generate the region.txt file to contain the zip code
and the region for each record. This data file is delimited with two
spaces between fields.
60525 North
60089 West
33321 South
60012 North
19444 West
44444 South
Properties of Record
The record data is presented sequentially. The Group
Subclass = Sequence.
The format of the data relies on syntax to separate components.
Each component can be identified by its position, or by a delimiter
in the data. The Group Subclass > Format = Explicit.
The Format > Component Syntax = Delimited.
Components are separated by two spaces. For the Delimiter >
Value, enter <SP><SP> or click (browse) and use the Symbols
dialog.
The location of the delimiter in the region.txt file is between the
data objects, therefore the Delimiter > Location = Infix. An
infix delimiter appears between each component.
The properties for the Record group type should be as follows:
Components of Record
Define ZipCode Field and Region Field as components of Record.
Properties of RegionRecordsFile
Define the properties of RegionRecordsFile. The
RegionRecordsFile group type has a Format of Implicit. The group
has no syntax property that distinguishes one component from
another.
Component of RegionRecordsFile
Define the Record group type as a component or
RegionRecordsFile.
Define the component range of Record. It is unknown how many
records are in the data.
Output Types
You need to generate an output file that consists of sales records.
Create the group types that represent this data.
Create the SalesRecord group type to represent these records.
Create the Report group type to represent the file that contains
the records.
Each sales record contains the contact person, the company name,
and the region.
The Contact Field, Company Field, and Region Field item
types represent these fields in each sales record.
Build and run this map to generate the region.txt output file.
The map rule for the SalesRecord object on the output card is:
=F_MakesSalesRecord (Contact:ContactFile,
LOOKUP (Record:RegionLookupFile,
ZipCode Field:Record:RegionLookupFile =
ZipCode Field:Contact:ContactFile ))
Optional Exercise
Create a SortRegion_Ascending map and use the SORTUP function
to generate results in ascending order. Use the region_asc.txt file as
the data source of the input card.
Optional Exercise
Copy the RegionReport executable map in the Customer.mms
map source file to create the new
RegionReport_SEARCHDOWN executable map.
Modify the input card #2 RegionLookupFile to use the
region_desc.txt as the data source.
Modify the map rule that calls the functional map to use the
SEARCHDOWN function instead of LOOKUP function.
Modify the output card to generate the RegionReportDOWN.txt.
Note Close all maps, type trees, and text files.
Objectives
This chapter defines how to locate an object in a certain position in a
series.
By completing the exercises for Chapter 8, you will learn how to:
Use the CHOOSE function to locate an object in a certain position in
a series.
Compiled map file RaffleCongrats.mmc Compiled map file that generates a text
file containing a message for each winner
and lists the prize won
Map build analysis *.mme Map build analysis results file generated
results file from the build process
Backup type tree *.bak Backup type tree files and map source files
and map files are created automatically during the Save
process
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solution folder. The structure and
use of these files is described in "Design Studio Tutorial Solutions" on
page xxii in the Introduction section of this tutorial.
Scenario
You have the results of a raffle drawing.
The winners.txt file lists the winners in the raffle. The first person in
the file won first place, the second person won second place, and so
on.
The winners.txt file lists the winners in order; Helen is the first
prizewinner, Florence is second, and so on:
Helen
Florence
Karen
Glenn
Betty
Robert
Toby
The prizes.txt file lists the raffle prizes and the place a winner must
achieve in order to receive that prize.
Here is the prizes.txt file:
Hot tub, 4
Couch, 6
Stereo, 3
Dog bone, 7
House, 1
Set of luggage, 5
Car, 2
You need to generate a file that notifies each winner of his or her prize,
and have the output file appear like this:
Congratulations, prizewinner1! You have won PRIZE X.
The CHOOSE function has two arguments and selects an object from a
series.
The first argument is the series of prize objects to choose from:
from_these_objects
The second argument is the index number of the object chosen:
pick_the_nth_one
Raffle Map
Create a map source file called Raffle that uses the prizes and winner
files as inputs.
Build and run the RaffleCongrats executable map. The results show
that each winner is matched with a prize.
Summary
You modified a type tree by creating group types to represent records,
and files of records. You defined components and component ranges.
You created a functional map and created a map rule using the
CHOOSE function to select a prize for a winner based on the winner
position in the winners.txt file.
Objectives
This exercise uses the first method to define logical breaks in the data.
By completing the exercises for Chapter 9, you will learn how to:
Count objects to determine breaks in the data.
Dock or float the Rule Bar and Navigator window.
Create a new type tree using the Merge Type command.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
6 Click Merge.
7 Click Close.
The new Address2.mtt type tree now contains only the Contact
object and the fields that are its components.
8 Close address.mtt.
9 In the Address2.mtt, create two new group types ContactSet
and NewContactFile as sequence group types with an implicit
format and no syntax.
10 Add the Contact group type as a component to ContactSet.
11 Define a component range for Contact.
If the number of Contacts in the file is not divisible by four, the last
Contacts are still considered a ContactSet, because the component
rule allows for sets with less than four. To enter the component rule,
use the Insert Function command to insert the COUNT function, use
the ($) shorthand notation for the current object, enter the less than
and equal sign operators (<=), and the count value of 4.
In the output data, Record has an explicit, fixed format. Each Record
contains the same number of characters of data.
Enter the map rule for the Record data object on the CompanyFile
output card to specify generation of the F_RecordMap function map.
Build and run the map. Note that each Record in the output file
consists of four Company fields from the input.
Summary
You learned how to count objects to determine breaks in the data.
Objectives
The input file contains a specific number of purchase orders. You want
to generate a file that contains a field that gives the count of the
purchase orders in the input file.
By completing the exercises for Chapter 10, you will learn how to:
Determine if the value of a certain item changes to determine
breaks in the data.
Identify and eliminate a type tree analysis error message about
distinguishability by using a component rule to find the last
record.
Use the COUNT function in a map rule to count the number of
items in an input file.
Use the index value [LAST] in a component rule to refer to the
last occurrence of that object.
Use $ shorthand notation in a component rule.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Open and analyze the Control.mtt type tree. The analysis results
display in the Analysis Results window.
Data Handling
The first record is processed and the component rule is validated as
true or false.
Note The index value [LAST] is interpreted as [1] when no
previous occurrences exist.
In the ctrl.txt input file:
12345 500 dress 065.99
12345 1000 pants 032.50
12345 300 suit 200.70
14478 275 pants 032.50
14478 500 suit 200.70
The first Record in the PO file, the component rule is interpreted as:
Is PO# Field:Record[1] = PO# Field:Record[1]?
Is PO# Field:Record[1] = PO# Field:Record[LAST]?
Is 12345 = 12345?
Is 12345 = 12345?
The following diagram shows how the component rule is evaluated
for the first four records in the data. As a result, the first three records
are determined to make up a single PO.
You want the map to generate a file that contains just one field that
gives the count of the purchase orders in the input file.
Build and run the MakeCountFile map. View the run results.
The content of the countpo.txt indicates there are two (2) purchase
orders.
Summary
You learned to determine a break in the data when the value of a
certain item changed. You also learned to eliminate a type tree
analysis error message about distinguish ability by using a
component rule to find the last record.
Objectives
This exercise uses a single input file to generate multiple output files
using partitions and attributes.
By completing the exercises for Chapter 11, you will learn how to:
Partition to simplify map rules.
Identify partitions in map rules and component rules.
Use the identifier attribute to distinguish record types.
Generate multiple output files from a single input file.
Use the CURRENTDATE function.
View type properties in the Map Designer.
View component numbers in the group window.
Text file Order.txt Output data file for the order entry
department that contains the
forecast and PO records in the input
data
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
A file contains a collection of records in no particular order. The
source of each record may be one of three kinds of business partners:
customers, suppliers, or distributors. In addition, each record
originates in one of three different applications: a forecast, purchase
order, or invoice application.
A particular field in each record indicates the business partner it came
from and another field indicates the associated application.
You want to create three different output files:
A file of invoices to send to an accounting department.
A file of purchase orders and forecasts to send to an order entry
department.
The type name appears in the rule cell with the partition (<>) and
component (:) separators: =Invoice<>Record:Collection.
Drag Forecast records from the input card to the rule cell for
Forecast on the output card.
Do the same for PO.
In this file, Invoice records are not desired, so enter =NONE in that
rule cell.
Build and run the OrdersByDept executable map to generate the two
output files: Acct.txt and Orders.txt.
#DistributorForecasts =COUNT
( Distributor<>Forecast<>Record:Collection )
Use the multiply (*) operator to multiply the data object by 100. For
example:
100 * #CustomerPOs Field:Report
The Report.txt contains statistics about the records in the input data.
Note Close all maps, type trees, and text files.
Summary
In the Deliver.mtt type tree, the record types are partitioned for six
different types of records:
Some data objects are not always present in the input file.
Objectives
This exercise maps optional input data objects.
By completing the exercises for Chapter 12, you will learn how to:
Map optional inputs.
Use category types to organize related types.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
A data file of statistics on states in the United States may include
population density, median household income, average summer
temperature, average winter temperature, and average yearly rainfall.
You need to generate a file that contains only the population statistics.
Input Data
The input data is provided in the Sts.txt file. This file contains
weather and human statistics on states in the United States:
Midwest:OH/257,3738/74,31,37:IL/,4285/76,26,33:IN/142,3687/75,29,39
Mountain:MT/5,3130/68,19,11:ID/8,2953/75,29,11:WY/3,3353/70,26,15
Plains:MN/48,3635/73,12,25:IA/,3549/74,20,33:MO/67,3458/78,32,35
The diagram shows how the data objects within a Region are
organized. A Region consists of a RegionID, and a series of States.
Each State consists of a StateID, Human, and Weather statistics.
The statistics for population density and household income are within
each Human data object. The statistics for average summer
temperature, average winter temperature, and average yearly rainfall
are within each Weather data object.
Component Ranges
The default component range is (1:1), indicating a minimum of one
occurrence and a maximum of one occurrence. When the component
ranges vary from this default, you must define accurate component
ranges.
The Region Input Data group type is a component of UnitedStates
Input Data. Define the component range to indicate some unknown
number of files.
The components of the Human group type are also optional. Indicate
these as optional components.
View the State type properties to see that fields within each state are
delimited with a forward slash (/).
The output.txt output file shows that a StatePop was not created
for the states having no Population Statistic. For example, IL had
no Population Statistic, and no IL data was created in the output.
Summary
You learned how to indicate optional input by using component
ranges. The default component range (1:1) is assumed and does not
display. Only component ranges with values other than (1:1) display
in group windows and on map cards. The delimiter identified missing
data.
This chapter defines how to map two input files into one output file.
Objectives
This chapter uses two input files to create one output file.
By completing the exercises for Chapter 13, you will learn how to:
Map two input files (one header and one detail file) into one
output file.
Use ellipses to shorten object names in component rules.
Use nested functional maps.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
You have a header file made up of header records. Each header record
includes a customer number, an account number, a purchase order
number, and a date. You also have a detail file made up of detail
records. The detail records include a purchase order number, an item
ID, a quantity, and a unit price.
You need to create an output file made up of purchase orders. Each
PO has a header and a set of details.
The Detail.txt detail input file is sorted to correspond with the data in
the header file. The first header record goes with the first set of detail
records, the second header record goes with the second set of detail
records, and so on.
The input data is shown below. The arrows indicate how each Header
Record corresponds to a particular set of Detail Records:
Using Ellipses
When the Use ellipses option is enabled, object names used in
component rules (Type Designer) and map rules (Map Designer) are
abbreviated to the shortest unique object name. Some object names
may not include ellipses, because the shortest unique name is the
entire name.
The Use Ellipses option does not affect object names that already
exist in component or map rules; it only affects object names that are
entered after the option is enabled.
Output PO
The PO Output Data group type describes the PO.txt output file.
There is one Header record and some unknown number of Detail
records.
CreatePO Input
Both input files are defined in the TwoFiles.mtt type tree.
Name input card #1 HeaderFile.
The Type for input card #1 is Header File Input Data.
– Use the CHOOSE function and the INDEX function to choose the
detail set in the detail file that corresponds with the same
header record in the header file.
Use the Functional Map Wizard to create the F_MakePO
functional map.
Summary
The two input files generated one output file. You used nested
functional maps to use the corresponding detail and header records.
In the functional map F_MakePO, the Header information in the
output is mapped from the Header in the input. The Detail
information is mapped from the Detail records, by using another
functional map: F_MakeDetail.
The PO.txt output file shows that the transformation server matched
the header with its corresponding detail set.
Note Close all maps, type trees, and text files.
In Chapter 13, the detail records in the Detail.txt file were in the same
order as the corresponding header records in the Header.txt file.
Your data may be in random order and not be sorted or organized into
sets.
Objectives
This exercise associates randomly ordered detail records with the
correct header record.
By completing the exercises for Chapter 14, you will learn how to:
Associate randomly sorted detail records with header records.
Use the EXTRACT function to extract a detail record from the detail
file when the PO# of the detail record is equal to the PO# of the
header record.
Close all run results windows at the same time.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Note The Tools > Options > Rule Bar > Use Ellipses option is
disabled in the example map rules shown in this chapter.
Disable or enable this option as you prefer.
Scenario
You have the detail records and header records in two input files. The
order of the records in the files is random.
Note The Detail.txt detail input file is not sorted to correspond
with the data in the header file.
Each header record includes a customer number, an account number,
a purchase order number, and a date. You also have a detail file made
up of detail records. The detail records include a purchase order
number, an item ID, a quantity, and a unit price.
You need to create an output file made up of purchase orders. Each
PO has a header and a set of details.
The detail file is not organized into sets of detail records. For example,
the detail records for purchase order number 144 are scattered
throughout the file.
The randomly sorted RandomDetails.txt input data file looks like:
175 aa533 100 2.35
175 aa045 15 3.70
100 aa011 10 6.90
144 aa097 25 4.32
175 aa022 40 2.25
144 aa045 10 5.60
RandomDetails Input
Both input files are defined in the TwoFiles.mtt type tree.
Name input card #1 HeaderFile.
The Type for input card #1 is Header File Input Data.
Summary
Randomly ordered detail records were associated with header records
by identifying matching purchase order numbers. The F_MakePO2
functional map processed the header records in the header file and
the detail file.
On the output card of the F_MakePO2 functional map, the map rule
for the Detail called the F_MakeDetail2 functional map.
This nested functional map used the EXTRACT function to extract
records where the purchase order number in the detail file equaled
the purchase order number in the header record.
Note Close all maps, type trees, and text files.
The trace file is a text file that records the progress during the
execution of a map. You can choose to trace the input data, the output
data or both. The trace file is a debugging aid used to diagnose invalid
data or incorrect type definitions.
Objectives
This exercise creates a trace file that can be used for debugging
purposes.
By completing the exercises for Chapter 15, you will learn how to:
Create a trace file.
View the trace file on the Trace tab on the Organizer window.
View the trace file in a separate window.
Understand the contents of a trace file.
Change the trace file settings.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
You want more information on your data validation.
Trace File
When input data is traced, the trace file provides a step-by-step
account of the data objects found, the reason the data is found to be
invalid, sizes and counts of data objects, and the data object position
in the data stream. When output data is traced, the trace file specifies
the objects that are built and the output objects that evaluate to
NONE.
A trace file of input messages contains a message for each input data
object that shows:
The level of the object in the card.
The offset of the data object in the data stream.
The length of the data object.
The component number of the data object.
The index of the component.
A portion of the actual data.
The name of the type to which it belongs.
For input data tracing, a message exists in the trace file for each input
data object indicating whether the data object is valid. If the data is
invalid, the message indicates the reason the data is invalid.
The trace file is created as specified after the map is compiled and
executed.
The default name of the trace file is the executable map name, plus
the file name extension .mtr. The default location of the trace file is
the map execution directory. A specific name and location of the trace
file can be defined in the Map Settings dialog.
For example, if your executable map name is RegionReport, the
trace file is RegionReport.mtr.
After you run a map, the trace file can be viewed on the Trace tab in
the organizer window or with any text editor.
The input data trace messages are at the beginning of the file.
Data Validation
Data validation occurs at item, group, and card object levels.
The first data item in the Header.txt file is the customer number (in
this case customer number 4500) as described by Customer# Field
item type in the TwoFiles.mtt.
Group Validation
A group is valid if the syntax is valid and all of its components are
valid. A group is validated component-by-component. A component is
valid if its type is valid, its component range is valid, and, if the
component has a rule, the rule evaluates to TRUE.
Note When a component rule is evaluated, any invalid data used
in a component rule is evaluated with a value of NONE.
After all of the components of a group have been found, a message in
the trace file indicates that the group itself was found.
For example, the Header group type trace message:
(Level 1: Offset 0, len 32, comp 1 of 1, #1, DI 00000005:)
Data at offset 0 ('4500 kes11 1') was found to be of TYPE
X'0006' (Header Record Input Data)
The trace message for Header File Input Data (the Type defined for
input card #1) is:
(Level 0: Offset 0, len 102, comp 1 of 0, #1, DI 00000010:)
Data at offset 0 ('4500 kes11 1') was found to be of TYPE
X'0004' (Header File Input Data).
The message following this card object appears after all of the
messages for the objects within that card:
INPUT 1 was valid.
Invalid Data
When a data object does not match the definition of the type to which
it presumably belongs, it could be invalid.
Following are possible reasons for an invalid data object:
Item value is not in restriction list
Item failed the presentation test
Item is the wrong size
Data object has the wrong delimiter
Data object has the wrong terminator
Data object failed the component rule
Group is missing a required component
Group contains one or more invalid component(s)
See the Map Designer Reference Guide for details on invalid data.
Summary
Trace files should be used only for debugging purposes because the
trace process impacts performance. Information in trace files can help
you debug input data, output data, and type property definitions.
Objectives
This chapter exports the New_POS map source file.
By completing the exercises for Chapter 16, you will learn how to:
Export a map source file.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this tutorial.
XML DTD
The mapsettings.dtd and the mms.dtd files are required to view
the exported xml file in a browser. These *.dtd files are provided in
the install_dir\mapimportexport\dtd folder.
Export maps to this install_dir\mapimportexport\dtd location or
copy these dtd files to the export map location.
5 Click Select.
The Maps exported successfully confirmation message
appears.
6 Click OK.
The resulting New_POS.xml file can be opened with a browser.
Summary
The exported xml open document interface is useful for:
Storing and retrieving map definitions in a repository.
Printing map definitions.
Global impact analysis.
Converting business rules from other sources to map rules.
Documentation.
Exported maps also provide an alternate format for storing map
definitions in XML format in version control systems. The
mapsettings.dtd and the mms.dtd files are required to view the
exported XML file in a browser.
Note Close all maps, type trees, and text files.
The xml files generated with the Map > Export command can be
imported into the Map Designer to create a map source file.
Objectives
This chapter imports a map source xml file.
By completing the exercises for Chapter 17, you will:
Create a map source file from an xml file.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Importing a Map
The XML file can be imported into the Map Designer to create a map
source file. If you want to view the map source file, the import location
should contain the associated type trees.
7 Click Select.
The Ascential DataStage TX Map Designer view confirmation
dialog appears.
8 Click No when prompted to view the map source file.
The map is imported.
Note To view the map source file, the associated type trees must
be present where specified in the map cards.
If the type trees are not in the directory specified in the map cards,
errors occur. In this example, the type trees are defined to be in the
same directory. The type trees are provided in the solutions file.
Summary
The xml file containing map source file details can be imported into
the Map Designer to create a map source file. Associated type trees
must be located in the import directory to avoid errors.
Invalid data can be rejected from the input data file by using the
REJECT function. This rejected data can be then mapped to an error
file to provide useful information that identifies errors in the input
data.
Objectives
This chapter maps invalid data using the REJECT function.
By completing the exercises for Chapter 18, you will view a working
map that:
Maps invalid data.
Uses the restart attribute.
Uses the REJECT function to create an error output file.
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this tutorial.
Restart Attribute
The restart attribute is used to identify valid data objects that contain
objects in error.
Summary
Mapping invalid data provides mechanisms to identify and isolate
invalid input data. Use the restart attribute to allow invalid data to be
processed. Use the error functions to identify the invalid data.
The Error Handling category on the Insert Function dialog
identifies the error handling functions you can use to map invalid
data.
Objectives
This chapter provides an overview of the three methods of
incrementing the position of an output object.
By completing the exercises for Chapter 19, you run maps that:
Increment output objects using the INDEX function.
Increment output objects using the COUNT function.
Increment output objects using the index value [LAST].
Backup type *.bak Backup type tree files and map source
tree and files are created automatically during
map files the Save process
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
You have a Header file and a Detail file. These files are to be mapped
to a PO file. In the header of each PO in the output, there is a field
whose value increments by one for each PO. In the first PO, it has the
value 1; in the second PO, it has the value 2; and so on.
The Increment map source file contains three maps using three
different methods of incrementing output.
The IndexOfPO item type is the last component of the Header group
type.
The File Output Data group type contains the PO group type, whose
components are the Header and the Detail group type (whose
components are the fields in the output file):
The map rule uses the CHOOSE function for the details, the INDEX
function for the header records, and the INDEX function for the current
purchase order (indicated with the shorthand notation of $).
Summary
Output objects can be incremented by counting, using the index value
LAST, or by using the INDEX function.
Objectives
This chapter provides an overview of creating a validation map.
By completing the exercises for Chapter 20, you will learn to:
Create a map to validate your type definitions.
Map source Contact.mms Map source file containing the Contact map,
file which maps a contact to a contact to validate
the type definitions
Map build *.mme Map build analysis results file generated from
analysis the build process
results file
Backup type *.bak Backup type tree files and map source files are
tree and map created automatically during the Save process
files
Copies of the files created during the exercises are provided for all
chapters in the install_dir\tutorial\solutions folder. The structure
and use of these files is described in "Design Studio Tutorial
Solutions" on page xxii in the Introduction section of this document.
Scenario
A validation map can be created to validate your input and output
type definitions.
Build and run the map. Compare your output file to your input file.
The number of input objects and output objects should match exactly.
If your output type definitions need changing, use a different type and
use the same method of comparision.
Summary
Confirming type definitions is simple with a validation map. Use
different type definitions as required.
C F
card settings function
exporting 16–5 inserting into a map rule 3–26
CHOOSE function 8–3 Functional map
Close All Run Results command 1–27 creating 13–8
command access –xix functional map
component rule 9–8 automatically creating 3–16
concatenating text in a map rule 3–24 definition of 3–12
control-break logic referencing in a map rule 7–13
using to define data 9–1 when to use 3–11
COUNT function 10–7 Functional Map Wizard
using in a component rule 9–8 using 3–16
cross-reference file functions
defining 6–4 CHOOSE 8–3
Customer Care iv COUNT 10–7
Customer Care, telephone iv EXTRACT 5–6
IF 3–25
D INDEX 19–5
data LOOKUP 7–12
definition of 1–19
rule bar
creating new line in 3–30
run results 1–25
command 3–32
viewing 3–32
S
SEARCHDOWN function 7–19
SEARCHUP function 7–17
shorthand notation in a component rule
$ 9–8
SORTDOWN function 7–16
Structure
analyzing in type definitions 2–18
T
text
concatenating in a map rule 3–24
entering in a map rule 3–24
TODATETIME function 6–19
trace file 15–1, 15–3
viewing 15–5
Type
creating groups 6–7
definitions
analyzing 2–18
type
inheritance 6–4
partitioned
mapping 11–12
U
UNIQUE function 4–8
V
viewing
run results 1–25, 3–32
trace file 15–5
W
wizard
using the Functional Map Wizard 3–16
X
XML
format for maps and map rules 16–2