Array Declaration in Buildop
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 46
- Joined: Tue Aug 10, 2004 11:07 am
- Location: Mclean VA
Array Declaration in Buildop
-- delete --
Last edited by hondaccord94 on Thu Aug 10, 2006 10:48 am, edited 1 time in total.
You can achieve this in a buildop.
Read the reference data in the pre-loop and place it in an array.
Manually or automatically read the input data and for each record write an output everytime you see a 'Y' in the indicator fields (deriving the appropriate values you need from the 4 rows of reference data).
Take a look at the advanced parallel developers guide for an explanation of buildops including the use readRecord(), transferRecord() etc.
You could also get the same result by converting the 'Y's to 1,2,3 or 4 based on which indicator field they are in using a transformer. If the transformer has 4 output links you can create a row of data for each indicator that is 'Y', converting it to 1,2,3 or 4. Run these through a lookup to derive reference values you require.
Read the reference data in the pre-loop and place it in an array.
Manually or automatically read the input data and for each record write an output everytime you see a 'Y' in the indicator fields (deriving the appropriate values you need from the 4 rows of reference data).
Take a look at the advanced parallel developers guide for an explanation of buildops including the use readRecord(), transferRecord() etc.
You could also get the same result by converting the 'Y's to 1,2,3 or 4 based on which indicator field they are in using a transformer. If the transformer has 4 output links you can create a row of data for each indicator that is 'Y', converting it to 1,2,3 or 4. Run these through a lookup to derive reference values you require.
-
- Participant
- Posts: 46
- Joined: Tue Aug 10, 2004 11:07 am
- Location: Mclean VA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I think the lookup_string_from_int16() function in a Modify stage would do brilliantly here. Pass all the looked-up columns into a Transformer stage where you can then combine the required ones into the desired row based on If..Then..Else conditions.
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.