output rows

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
deepthi
Participant
Posts: 56
Joined: Thu Apr 28, 2005 9:52 am

output rows

Post by deepthi »

Hi All,
I have a sequential file with the below format
i/p file o/p file
Code Name Gender code ErrorName
001 abc F 002 Invalid Gender
002 bcd A 003 Invalid Name
003 12 R 003 Invalid Gender
004 10 M 004 Invalid Name
.. ... ..
I could able to write the logic in the transformer for the Name And Gender error, but when the the error is occuring in the both Columns, only one row with the first corresponding error is shown eg:" 003 Invalid Name" is at the out put but one more row with "003 Invalid Gender" is not showing in the output.
How should i put the logic to get one more row for the same code.

Thank you
Anu
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

I really can't track your data example. Separate your files into distinct rows when posting please, it's really awkward the way you did it.

If what you are saying is that one input row could have multiple issues, and you want each issue to be a separate output row, then you have to rethink your job design. You'll need to add extra output links and use a link collector to collate the extra rows. Each condition gets it's own output link with a constraint that only allows a row that violates a given condition.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

May be you can use two different links (writing to the same file)

For One Link
Use First Condition
For Invalid Name

For the Other Link
Use Second Condition
For Invalid Gender

In this way, if both the condition are met, the row is output to both of the link, that's what you want, may be :?:
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

loveojha2 wrote:May be you can use two different links (writing to the same file)
Only if it's a hash file. Sequential files can't have multiple input links to the same file, they have to be separate files and later you concatenate. Using a hash file solves this issue as long as the primary key is unique, but you have to deal with one of the links creating the hash file. The link collector solves all of these problems nicely.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Build the error messages in stage variables, setting them to " " (space) if no error. The column to be output is the trimmed concatenation of all (both) the stage variables.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply