Page 1 of 1

Dynamic filter

Posted: Mon Jun 07, 2010 9:20 am
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

Posted: Mon Jun 07, 2010 11:04 am
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.