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
Using @Iteration Loop Condition
Moderators: chulett, rschirm, roy
Using @Iteration Loop Condition
SCOTTDun
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Do B and C get populated in all three rows in your example?
Your need to iterate through a delimited list is one of the examples in the documentation, almost exactly. Count the number of delimited fields into a stage variable, say svItemCount, then your loop exit condition is Within the loop, use a Field() function to extract the particular value:
Your need to iterate through a delimited list is one of the examples in the documentation, almost exactly. Count the number of delimited fields into a stage variable, say svItemCount, then your loop exit condition is
Code: Select all
@ITERATION <= svItemCount
Code: Select all
Field(InLink.A, ":", @ITERATION, 1)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.