What's the best method to write complex derivations?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

IASAQ
Premium Member
Premium Member
Posts: 31
Joined: Wed May 04, 2016 11:07 am
Location: Montréal

Post by IASAQ »

ray.wurlod wrote:However, multi-statement blocks are not available in expressions; indeed no form of statement is available in an expression.
Alright, so that clears it as far complex derivation is concerned in a single expression cell. Disappointing but that's what it is.
ray.wurlod also wrote:I continue to maintain that your example could be done in a single expression with no stage variables. But using stage variables would make it easier to understand and therefore more easily maintained.
Forget my example for a second Ray. Basically, what you're saying is that if I had 5 input fields mapped to 5 output fields and each input field required 5 manipulations before being mapped to those 5 output fields, I would need 25 stage variables if I wanted to be clean?

By the way, thanks for the replies to all who contribute on this site. Your knowledge is appreciated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Short answer? Yes. Assuming none of the derivations are 'global' or could be used across multiple fields or easily combined. It's about style and readability, I'd use as many stage variables as it took with self-documenting names in order to make the cooking up of something complex much easier to understand when someone else looks at it. And that number taken on its own really isn't a big deal, at least not in my book, if that's really what it takes to do what you need done.
-craig

"You can never have too many knives" -- Logan Nine Fingers
IASAQ
Premium Member
Premium Member
Posts: 31
Joined: Wed May 04, 2016 11:07 am
Location: Montréal

Post by IASAQ »

Ok, thanks chulett. It's completely clear now. Can't say I like it compared to how Data Manager handles derivations but hey, gotta adapt right?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply