Array Declaration in Buildop

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
hondaccord94
Participant
Posts: 46
Joined: Tue Aug 10, 2004 11:07 am
Location: Mclean VA

Array Declaration in Buildop

Post by hondaccord94 »

-- delete --
Last edited by hondaccord94 on Thu Aug 10, 2006 10:48 am, edited 1 time in total.
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

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.
hondaccord94
Participant
Posts: 46
Joined: Tue Aug 10, 2004 11:07 am
Location: Mclean VA

Post by hondaccord94 »

Thank you. I will give it a try. I will try with transformer first.

Can you please let me know, how can I delcare an array of the reference table. Looks multi - dimensional to me.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

Good call Ray. I only watched the video tech tip on Sunday and still I didn't think of using lookup_string_from_int16() function in a Modify stage. :oops:
Post Reply