What is the best way to implement lengthy business logic in a parallel job. My specif problem is that I have an IF statement with 100 conditions each performing a different calculation. Also, the IF condition stays the same for each column, but the calculations change. Ex: In col1 IF col0=1 then col1*col0... then in col2: IF col0=1 then col2*4. I would rather not have this huge IF statement repeated for each column. What do you suggest is the best apprach for this situation. Custom routine? Custom stage? The way I did is the best way, etc...
DS 7.5x2 Parallel job.
Best parcatices for business logic
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
I would first try to build it using a lookup table, though this depends on whether the equation fits a lookup table design. Second I would try stage variable code which works well for up to three lines of code per stage variable but is stretched beyond that. Third is probably external routine so you can code it as a black box module. I think dozens of custom routines that do one particular equation are more maintainable than a custom stage with hundreds of lines of code.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Yes..a Lookup table in which all the logic can be captured would be the best bet. If this is too much in asking, part of it can be in the lookup and the rest in the Transformer logic[using stage variables] or Go for a Build-Op. Just my 2centsvmcburney wrote:I would first try to build it using a lookup table, though this depends on whether the equation fits a lookup table design. Second I would try stage variable code which works well for up to three lines of code per stage variable but is stretched beyond that. Third is probably external routine so you can code it as a black box module. I think dozens of custom routines that do one particular equation are more maintainable than a custom stage with hundreds of lines of code.