Stop Datastage Job

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
avi21st
Charter Member
Charter Member
Posts: 135
Joined: Thu May 26, 2005 10:21 am
Location: USA

Stop Datastage Job

Post by avi21st »

Hi

I am designing the automation process of my project- In this process there is a Unix daemon process. All the time this Unix process would be running with 10 minute sleep. the process would trigger a shell which runs the datastage job using a dsjob -run.

Here I am implementing File watcher concept- If there is a new file in the SourceFile folder I would trigger a Datastage Job which would load the file to the respective table.

Now my question is I am executing the Unix daemon process from Datastage Job Sequencer as a execute activity. If I need to stop the process is kill -9 is enough or I need to stop the Datastage job.

If I need to stop the datastage job from as shell how to do that?
Thanks for your help
Avishek Mukherjee
Data Integration Architect
Chicago, IL, USA.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Never ever kill with a -9. This can corrupt repository tables. use kill -15 or just kill. If you have a tightly wound loop then you may not be able to kill it.

I do not see an option to stop a job otherwise. You can do it from a routine. If you knew enough about BASIC then you could create a TCL command to do it.

Code: Select all

      RunHandle = DSAttachJob(JobName, DSJ.ERRNONE)
      JStat = DSStopJob(RunHandle)
      JStat = DSDetachJob(RunHandle)
These 3 API calls are what you need to create a BASIC routine to do it. To create a TCL command then you need to write a real BASIC program and CATALOG it. Do a search. I have talked about this before.

A more graceful way to shut this process down is to have it look for a file like STOPDSJOB. If it sees this file then it ends itself. You already have the logic to look for files. Use it.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sage words. Heed them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If I remember correctly, you can only attach to using the API and then delete a running job if your process was the one that started it. I think I ran into that issue a while back, but I'll check when I get to a DS computer.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Seconding the sageness. Especially the build of an automated out request, something I always build into any process like this.
-craig

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