Stopping a Sequence using Wait for File stage

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

Post Reply
droberts
Premium Member
Premium Member
Posts: 38
Joined: Wed Apr 01, 2009 4:34 am
Location: UK

Stopping a Sequence using Wait for File stage

Post by droberts »

Hi,

I have a requirement to stop a sequence from running if and when a support function needs to do so.

My first thoughts were to use a wait for file stage in the master sequence, and if the file arrives, it triggers a terminator stage. However, I have not used a wait for file stage before and the use of the timeout (and its implications) are not clear.

Any better suggestions are welcome. The one caveat is that the support function do not have datastage access, hence us the use of wait for file to stop the sequence when they create a file in a specific directory.

Thanks

DR
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Still need more details to help you out

- What are you calling from this sequence job?
- What do you mean by "Stop" the sequence job, if you are calling job/s out of this sequence job it will not stop all these jobs immediately.
- Is there any certain time window where you want to check for inbound file?

you can not do "wait for file" and running/controlling other child job/process in same master job.

"wait for file" only helps you when you are using it as standalone process.

Write shell-script to execute command "dsjob -stop" with all required parameters when inbound/trigger file is there on server.
droberts
Premium Member
Premium Member
Posts: 38
Joined: Wed Apr 01, 2009 4:34 am
Location: UK

Post by droberts »

swades wrote:Still need more details to help you out

- What are you calling from this sequence job?
This is the master sequence which calls child sequences. If I stop thatm it will stop any child sequences executing.

- What do you mean by "Stop" the sequence job, if you are calling job/s out of this sequence job it will not stop all these jobs immediately.
That is fine, as long as the jobs stop within a reasonable timeframe

- Is there any certain time window where you want to check for inbound file?
From the start of the master sequence to the completion

you can not do "wait for file" and running/controlling other child job/process in same master job.

"wait for file" only helps you when you are using it as standalone process.

Write shell-script to execute command "dsjob -stop" with all required parameters when inbound/trigger file is there on server.
Have replied in bold in the quotation - thanks for the reply :)

How would I invoke the shell script in EE? Thanks in advance :)

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

Post by chulett »

The WFF stage is a 'blocking' stage.

Clarify something - are you saying that you need a Sequence job to stop when a file arrives at any point over the run of the Sequence? If so, there's no way to do that without having some sort of looping construct such that you do something, wait, check for file and then repeat the loop. Or you'd need to have a file check between every activity in the Sequence.
-craig

"You can never have too many knives" -- Logan Nine Fingers
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

droberts wrote:How would I invoke the shell script in EE? ...
For your requirement, write shell-script which is looking for particular source file at given location using "loop", execute this shell-script isolated from your EE sequence job ,and if file found during the time when master sequence job running stop the job.

Create and delete one dummy flat file before and after every successful run of master job to make sure if source file (from support team) found when master job is not running, it will not try to STOP the job.

I hope this will help you to implement your requirement.
droberts
Premium Member
Premium Member
Posts: 38
Joined: Wed Apr 01, 2009 4:34 am
Location: UK

Post by droberts »

Sorry guys, I never saw the replies above :oops:

Thanks for replying, we have gone on to using a different strategy.

Daren
Post Reply