Rules Based DataStage Jobs

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
bkarth
Premium Member
Premium Member
Posts: 9
Joined: Wed Oct 26, 2005 2:04 pm

Rules Based DataStage Jobs

Post by bkarth »

Anyone can share a sample Rules based DataStage server job?

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

Post 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)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bkarth
Premium Member
Premium Member
Posts: 9
Joined: Wed Oct 26, 2005 2:04 pm

Thanks a lot

Post 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
lna_dsuser
Premium Member
Premium Member
Posts: 29
Joined: Tue Aug 14, 2012 1:06 pm

Post 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
Post Reply