Page 1 of 1

Rules Based DataStage Jobs

Posted: Thu Sep 11, 2008 2:15 pm
by bkarth
Anyone can share a sample Rules based DataStage server job?

Thanks
KB

Posted: Thu Sep 11, 2008 3:47 pm
by ray.wurlod
You need a "rules dispatcher" routine and individual routines that check each rule, returning a true/false value. Use "indirect call" (see DataStage BASIC manual) to achieve late binding in the rules dispatcher; your job passes the rule name "Rule42" and the rule routine has a name that is, or includes, this name.

Code: Select all

FUNCTIONRuleDispatcher(RuleName, RuleData)
Ans = @FALSE
RuleSubr = RuleName
Call @RuleSubr(Ans, RuleData)
RETURN(Ans)

Code: Select all

FUNCTION Rule42(RuleData)
Ans = (RuleData = "FORTY TWO")  ; * business rule
RETURN(Ans)

Thanks a lot

Posted: Mon Sep 15, 2008 2:31 pm
by bkarth
Thanks a lot Ray, I will look into these routines further. I am also thinking other ways like using Job sequencer or Shared Container.

Thanks again for your response.

Regards,
KB

Posted: Wed Oct 19, 2016 7:38 am
by lna_dsuser
This is opening up an old thread but since the topic is related, didn't want to start a new one 8)

With reference to the "Rules Dispatcher" approach, essentially the "Rule" still needs to be predefined in one of the routines in which case any new logical rule will still require a DataStage deployment. Correct :?:

Here in the team we've been throwing around ideas on the board if there would be a way to apply "new" rules through a parameter or lookup table content which would of course require knowledge of the DataStage artifacts but not necessarily a DataStage deployment. :?

Thanks