$ReturnValue behaviour 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
eldonp
Participant
Posts: 47
Joined: Thu Jun 19, 2003 3:49 am

$ReturnValue behaviour in sequencer

Post by eldonp »

I am trying to implement a dependency in a sequencer. I am required to wait until a certain count is equal or greater than 34 before running a dependent job.

I have some uncertainty about the way the 'Custom' Expression Type inside the Nested Condition stage of the sequencer is evaluating the value.

GetCountJob1 writes the value that I need to evaluate into a flat file.
HeadCommand1 performs a head command on the flat file to retrieve the value.
NestedCondition1 evaluates the result and triggers the appropriate link.

Here is the job flow:

Code: Select all

GetCountJob1 > HeadCommand1 > NestedCondition1 ($ReturnValue<34)1 > Sequencer1 (Any) > GetCountJob2
                                                                                                   
                                  |                                    ^                  |
                                                                                                   
                             (Otherwise)1                   ($ReturnValue<34)2        HeadCommand2
                                                                                                   
                                  |                                         \             |
                                                                                                   
                                  |                                                   NestedCondition2
                                                                                                   
                                  |                                         /
                                                                                                   
                             RunDedpendentJob     <-        (Otherwise)

Problem is that when the GetCountJob1 job runs and the NestedCondition1.$ReturnValue is less than 34, the loop (GetCountJob2, HeadCommand2, NestedCondition2) runs. However when the NestedCondition2.$ReturnValue is less than 34, the looping ends and the dependent job runs anyway.

The exact condition within the NestedCondition is:

Code: Select all

Head.$ReturnValue<34
I also get a message in the log:

Code: Select all

DEP_SEQ..JobControl (@Coordinator): Note: Sequencer 'Sequencer1' was entered, but never exited
Any ideas - is there a logical flaw here? Where is the problem that the loop does not wait for the count to be 34 before ending - and the reason for the message?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your job flow ascii art is hard to grok. :?

Short answer - try this in your trigger:

Code: Select all

Head.$ReturnValue<1> < 34
-or-
Convert(@FM,'',Head.$ReturnValue) < 34
As for your message, it means exactly what it says. Flow went into the Sequencer but nothing ever came out the other side. This typically occurs when multiple links go into an 'All' Sequencer and not all input links 'fire' so the output link is not allowed to fire.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ps. It would be simpler if you learned about and starting using the 'user status' area in jobs. No intermediate file needed, no funky trigger handling, just a job that stashes something there and then $UserStatus can be used directly.

Search the forums for either "user status" or "USERSTATUS" as this has been discussed quite a bit.
-craig

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