Page 1 of 1

output rows

Posted: Tue Nov 08, 2005 9:54 pm
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

Posted: Tue Nov 08, 2005 10:04 pm
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.

Posted: Tue Nov 08, 2005 10:08 pm
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 :?:

Posted: Tue Nov 08, 2005 10:32 pm
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.

Posted: Wed Nov 09, 2005 3:06 am
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.