lfong,
Glad you got it working! Thanks for sharing the good news. You've learned the hard way that you have to define your output metadata first before filling out the rest of the stage.
I was in the midst of typing this long reply, so instead of wasting it, perhaps someone else can benefit later.
----------------------
It takes a bit to get comfortable with the Column Import stage, so let's see if I can do a better job explaining.
You are correct; the output from the first Column Import stage becomes input to the second. But you need 2 Column Import stages because you can only parse a single column at a time with this stage. Since you have 2 columns to parse (COL1 & COL3 in our example), we'll need 2 stages.
Now let's just walk through Record A. We've already defined the metadata for the Sequential File stage, and it has 3 columns.
Next, we go to a Switch. There, we'll define "Selector = RecTyp", and our User-defined Mapping will be Case=A=0 (meaning, a RecTyp of "A" will go down link 0). In Output | Mapping just copy all the columns over.
In the first Column Import stage, go to Output | Columns and define this metadata:
field1 Char(4)
field2 Char(2)
RecTyp Char(1)
COL3 VarChar(23)
In Stage | Properties set "Import Input Column" = COL1. Then, click on "Column To Import" and you will see a bunch of boxes come into focus in the middle. Pick the bottom box, which allows you to select available columns -- choose field1 & field2. Now when you go to Output | Mapping you will see how Column Import actually parses a column.
On to the second Column Import. Define ALL your columns in Output | Columns. This time, your "Import Input Column" = COL3, and your columns to import are field5 & field6.
creating multiple output record layouts based on rec type
Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 21
- Joined: Mon Mar 08, 2004 11:42 am
Return to “IBM<sup>®</sup> DataStage Enterprise Edition (Formerly Parallel Extender/PX)”
Jump to
- Moderators' Choice
- ↳ Editor's BLOG Corner
- ↳ Ask the Experts! - Dads and Grads
- ↳ DSXchange Testimonials
- ↳ Cognos (IBM BI)
- FAQs
- ↳ FAQs
- ↳ FAQ Discussion
- DataStage
- ↳ General
- ↳ IBM<sup>®</sup> Infosphere DataStage Server Edition
- ↳ IBM<sup>®</sup> DataStage Enterprise Edition (Formerly Parallel Extender/PX)
- ↳ Archive of DataStage Users@Oliver.com
- IBM<sup>®</sup>Infosphere Products<sup></sup>
- ↳ Business Glossary
- Suggestions
- ↳ Site/Forum
- ↳ Enhancement Wish List
- Consulting
- ↳ Talent
- ↳ Looking for Talent
- Support
- ↳ Parameter Manager
- ↳ Compile All Plus
- Usergroup Forums
- ↳ Usergroup Central Forum
- ↳ Heartland Usergroup Forum
- The Written Word
- ↳ Articles, White Papers and Tips and Tricks
- ↳ Product Documentation
- Third Party Applications
- ↳ Third Party Applications
- Product Derivatives
- ↳ Functions
- ↳ Routines
- ↳ Jobs
- ↳ Logs
- Tools
- ↳ Tools Forum
- Category
- ↳ Infosphere Master Data Management
- ↳ Data Quality Best Practices
- ↳ IBM QualityStage
- ↳ Information Analyzer (formerly ProfileStage)
- ↳ IBM<sup>®</sup> SOA Editions (Formerly RTI Services)
- ↳ IBM<sup>®</sup> DataStage TX
- ↳ BI
- ↳ Data Integration