Dynamic filter

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
senthil_tcs
Premium Member
Premium Member
Posts: 40
Joined: Tue Oct 14, 2008 3:30 pm
Location: London

Dynamic filter

Post by senthil_tcs »

Hi,

We have a requirement to split the records based on the Category Code and load to MQ. The Category Code can be dynamic and we have around 20+ category codes so I don't want to use transformer or filter to split the records based on Category Code. Is there any way other way of doing this? The option which I could think is to use a loop activity in a sequencer and pass the Category Code as comma separated value (Do distinct from reference data table to get category codes). This may not be performant as we will pass the values in sequence, Is there any other way of implementing the same in DataStage? Any help much appreciated.

Thanks,
Senthil Kumar
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

I think you've hit on the only method I've ever used. Depending on where you get the data from you'd either have to do a SELECT DISTINCT (database) or a DataStage Aggregator-type job to get a comma-separated list of current Category Codes. Then feed that list to a Sequencer loop that passes each code as a parameter to a job.

As you noted, that can take eons of time in a message-based system like MQ. Especially if you have lots of codes. The only alternative is to get the originators to provide you with a comprehensive list of codes and use a Filter stage to route data. You'd need a "Else" type clause to route to an abort link in case a new code sneaks in.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
Post Reply