Set job status to "not compiled"

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
Joshi
Premium Member
Premium Member
Posts: 17
Joined: Mon Aug 18, 2003 11:59 pm
Location: Germany

Set job status to "not compiled"

Post by Joshi »

Hello,

we have a very long chain of sequences and sometimes we need to interrupt this chain. To do this, we set the job status of a job to "not compiled". For the time being, this is done by compiling the job with an error. Is there a way to do this by a routine?

Regards,

Joshi.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
IMHO, your method is crashing the process and thus not a desirable solution.

I prefer using stop from director;
Or putting check-points in your flow that select a value from a control table, If it is set to continue the flow continues, otherwise it logs the event + send notifications and finishes.

in this way when you want to stop the ong flow you simply update the value in the control table and it will stop in an orderly mannor at the first next check point you have.

P.S:
I'm not sure if version 6 has the DSStopJob, if it does you can use it to stop the job.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Joshi - that's an... interesting... solution. Not something I would have thought of, mostly because our Production jobs are read only and can't be horked with like that. :wink:

Suggest you build checkpoints into the process, much like Roy mentions. I've taken more of an approach in the past of assinging a directory as a 'polling' directory and then having a routine that can look in that directory for certain flag files. Find a flag and issue an abort or whatever else seems appropriate at the time. Sprinkle them in the job chain. Then all you need to do is create the appropriate flag file (no records in it, just the file itself) and things will wind down.

Food for thought...
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

DSStopJob was available in version 5

Code: Select all

 $INCLUDE DSINCLUDE JOBCONTROL.H
     RunHandle = DSAttachJob(JobName, DSJ.ERRNONE)
            JStat = DSStopJob(RunHandle)
      JStat = DSDetachJob(RunHandle)
Here are 3 lines of code to do it. There was lots of code in between to make sure the job was running and I attached properly but this should get you close.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Insert some other Activities to give you the control. Use Routine, Execute Command or Nested Condition Activities - you can effect your control with any of them. For example, an Execute Command activity could test for the existence of a file (you could even use a Wait For File activity here).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply