Bypassing notification activity in a sequencer

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

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

Post by ray.wurlod »

Why do you think one of his job titles is "analyst"? :lol:

He could (should?) have pointed out that what's postulated is not even possible in a sequencer.

It is, of course, possible in a job sequence.

The only thing you can do in a sequencer is fire its output trigger(s) if any or all of its inputs have fired.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ray.wurlod wrote:Why do you think one of his job titles is "analyst"? :lol:

He could (should?) have pointed out that what's postulated is not even possible in a sequencer.

It is, of course, possible in a job sequence.

The only thing you can do in a sequencer is fire its output trigger(s) if any or all of its inputs have fired.
Oy... let's not mention any of my other 'job titles', shall we? :P

And I missed the whole 'sequencer' thing in the subject. Dang, time for another round of self-flagellation. 'Attention to detail, lad!' as someone would say...
-craig

"You can never have too many knives" -- Logan Nine Fingers
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

Eventhough I found a solution, I don't think it is best one. Now, I have 2 different sequences. One does all the work and looping for the Wait_For_File_Activity stage. The other will fire at a certain time based on the scheduler and check if the file exists through UNIX. If it doesn't, then it'll notify. I am sure this can be done in 1 job sequence but I can't think of any ideas yet.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Do you want to recap why you don't currently have it all in one right now? I don't really understand the relationship between the two in your last post or what issues you've been facing other than the Notification trigger, even after re-skimming the entire thread. Your two different sequences - is one a sub-sequence run by the other or are they discrete sequences? :?

Be glad to attempt to help if you can state how it all should be working.
-craig

"You can never have too many knives" -- Logan Nine Fingers
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

These are 2 distinct sequences. One has an ExecCommand followed by a NotificationActivity. If there is no row in the folder at 12 noon then an email is sent.

In the first sequencer, I have a loop. Inside the loop, I have a Wait_For_File activity stage. This checks for the file every minute. If at noon (system time), the file has not arrived, an email is supposed to be sent. My Wait_For_File stage continues on the same path in the loop even if the file is found or not. What I want to do is, if the file is not found and current time is past noon, I want to send an email. I want this to happen just once.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

Ok. For now at least, I have given up hope of combining the 2 sequencers. Can someone help me with the second sequencer problem?

I have a simple ls command in the ExecCommand activity stage. If it is greater than 0, I want to move on to the next stage in the sequencer, if it is not, I don't want to do anything else. I just have 2 stages in the sequencer. I have set a ReturnValue > 0 in the Triggers page of the ExecCommand stage. However, this doesn't work. Regardless of the
value I set, in the log it says "No such file or directory" even if there is one and it doesn't go to the next stage.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What are you trying to do here. Are you trying to see if there are any files present. Then you need to provide

Code: Select all

ls /fully/qualified/path | wc -l
this will tell you all the files. Well not all. Files that start with a dot (.) will not be counted.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

It still doesn't work. In the triggers page of the ExecCommand activity, I have

Expression Type: ReturnValue(Conditional)
Expression = 0

This means that if there is a file, it should NOT go on to the next stage in the sequencer
and end. If there is no file, then it should go into the next stage. This doesn't happen.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post your "simple ls command".
-craig

"You can never have too many knives" -- Logan Nine Fingers
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

ls /Folder1/SubFolder1/*.zip | wc -l
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

Also, my sequencer has just 2 stages. First, an ExecuteCommand stage and then a Notification Activity stage. For a certain value, I want the flow to go to the Notification stage otherwise I just want the sequencer stage to end there. Do I have to have another stage for different values?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Screen output from commands are returned in a dynamic array, so you'll get more than just the count returned. There just was a nice thread on all this, I'll have to see if I can dig it up.

You need to check the first element of the returned value for zero, either that or filter out the @FM characters that are goofing you up right now. So, try this as a Custom expression:

Code: Select all

RoutineActivity.$ReturnValue<1>=0
For you 'file not found' trigger.
-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 »

splayer wrote:Also, my sequencer has just 2 stages. First, an ExecuteCommand stage and then a Notification Activity stage. For a certain value, I want the flow to go to the Notification stage otherwise I just want the sequencer stage to end there. Do I have to have another stage for different values?
No, just don't define a trigger for these 'other values' and it will end right there.
-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 »

This is the post I was referring to above:

viewtopic.php?t=105955
-craig

"You can never have too many knives" -- Logan Nine Fingers
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

This is what I have now.

ExecCommand --> Notification

On the ExecCommand, this is what I have in the Triggers page:
Expression Type: Custom - (Conditional)
Expression: ExecCommand.$ReturnValue<1>=0

DOES NOT WORK. I get a notification whether there is a file there or not. Thanks for all your help.
Post Reply