Parameter values used in Nested Condition in Sequencer

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
JPalatianos
Premium Member
Premium Member
Posts: 306
Joined: Wed Jun 21, 2006 11:41 am

Parameter values used in Nested Condition in Sequencer

Post by JPalatianos »

I've created a Hash file for needed parameters. I have one value defined as UtilityHashLookup('hshDateTime','1',2) which gives me the current month of the data. I wanted use this value in a nested condition stage saying which path I wanted based on the Month. My expression was UtilityHashLookup('hshDateTime','1',2) = 'P01 ' OR 'P02' OR 'P03 ' run JobA
I have a set for each quarter and a termination if the value doesn't match. I've tried several different ways to try to get the value recognized but no matter what I try all four paths run.


Any suggestions are greatly appreciated.

Thanks
John
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First off, that's not a proper expression. It would need to be:

Code: Select all

UtilityHashLookup('hshDateTime','1',2) = 'P01' OR 
UtilityHashLookup('hshDateTime','1',2) = 'P02' OR 
UtilityHashLookup('hshDateTime','1',2) = 'P03' 
to evaluate correctly, but that would run the utility three times. Or you'd need some kind of matches logic in a single equality test. Also note that two of the three quoted values have a space at the end.

Seems to me you should be considering the User Variables stage to assign the result of the UtilityHashLookup to a variable and then simply check the variable afterwards.
-craig

"You can never have too many knives" -- Logan Nine Fingers
JPalatianos
Premium Member
Premium Member
Posts: 306
Joined: Wed Jun 21, 2006 11:41 am

Post by JPalatianos »

Thanks Craig,
I should have been a bit more clear ast to how I was processing. I am using the User Variable stage with the UtilitHashLookup function which assigns a variable wich is used downstream in the nested condition. The spaces were added because I have tried the expressions without spaces and then was experimenting to see if I can get it to work.....
My concern is that I have 4 legs coming out of the Nested Condition Stage and all 4 execute. I would expect if the syntax was not valid to not have any executing.

Thanx again for your comments ~ ~ John
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

'Invalid' expressions generally evalute to TRUE and so always trigger. Or more properly, anything that evaluates to '0' is FALSE and everything else is TRUE.

Can you post your actual code from each link from the Nested stage?
-craig

"You can never have too many knives" -- Logan Nine Fingers
JPalatianos
Premium Member
Premium Member
Posts: 306
Joined: Wed Jun 21, 2006 11:41 am

Post by JPalatianos »

SUre...within the nested condition in the triggers tab I have each of the link names under the name column "Custom-(Conditional)" for Expression type and one of these for the expresion column
PERIOD = 'P11 ' Or PERIOD = 'P12 ' Or PERIOD = 'P10 ' For DSLink11
PERIOD = 'P07 ' OR PERIOD = 'P08 ' OR PERIOD = 'P09 ' For DSLink9
PERIOD = 'P04 ' OR PERIOD = 'P05 ' OR PERIOD = 'P06 ' For DSLink7
PERIOD = 'P01 ' OR 'PERIOD = P02 ' OR PERIOD = 'P03 ' For DSLink5

Thanks again ~ ~ John
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If PERIOD is a value in your User Variables stage, you can't refer to it just by name. You need to prepend the stage name to it as well. So if the stage was called Fred then:

Code: Select all

Fred.PERIOD = 'P11 ' Or Fred.PERIOD = 'P12 ' Or Fred.PERIOD = 'P10 '
Would be more appropriate. If you used the External Parameter Helper thingy it would do that for you. :wink:

Hope that helps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
JPalatianos
Premium Member
Premium Member
Posts: 306
Joined: Wed Jun 21, 2006 11:41 am

Post by JPalatianos »

Thanks Craig!!!!

That was it...I was missing the STage name.
Post Reply