Using @Iteration Loop Condition
Posted: Tue Apr 04, 2017 1:27 pm
Hi,
I am creating a job in which I need to use an iteration. The job I have has a seq. file with one row of data, two transformers and im mapping to a table using db2 connector. In the first transformer, I have the columns mapped to what the table looks like. The second transformer will have a loop iteration I am thinking.
There is a field that will be populated and in the first transformer I am leaving it as spaces. Three columns from the seq file will be used to populate the the field that I put to spaces but depending on what happens to the three columns. Column A will be populated with number sets that are colon separated (ex 111:222:333), Column B will be '159' or spaces (If Y then 159 else 0) and Column C will be '158' or spaces.
The Iteration should be used to populate the one field (that is presently set to spaces in transformer 1) in transformer 2. My iteration is if Iteration =1 then column A Else If iteration 2 then column B Else Column C. However, if B is spaces, then I want to eliminate that from populating; same goes for C.
So I need a minimum of Column A to be populated and then have each number that is colon separated to have their own row (ex 111:222:333 needs to be 111 then another row with 222 etc). If Column B has 159 then it gets populated and if Column C has 158 it gets populated. If B or C or both have spaces, then they do not get populated.
I need a little help with the Iteration statement, so any and all help is very much appreciated.
Thanks
I am creating a job in which I need to use an iteration. The job I have has a seq. file with one row of data, two transformers and im mapping to a table using db2 connector. In the first transformer, I have the columns mapped to what the table looks like. The second transformer will have a loop iteration I am thinking.
There is a field that will be populated and in the first transformer I am leaving it as spaces. Three columns from the seq file will be used to populate the the field that I put to spaces but depending on what happens to the three columns. Column A will be populated with number sets that are colon separated (ex 111:222:333), Column B will be '159' or spaces (If Y then 159 else 0) and Column C will be '158' or spaces.
The Iteration should be used to populate the one field (that is presently set to spaces in transformer 1) in transformer 2. My iteration is if Iteration =1 then column A Else If iteration 2 then column B Else Column C. However, if B is spaces, then I want to eliminate that from populating; same goes for C.
So I need a minimum of Column A to be populated and then have each number that is colon separated to have their own row (ex 111:222:333 needs to be 111 then another row with 222 etc). If Column B has 159 then it gets populated and if Column C has 158 it gets populated. If B or C or both have spaces, then they do not get populated.
I need a little help with the Iteration statement, so any and all help is very much appreciated.
Thanks