After Job Routine for Job Sequence

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
theverma
Participant
Posts: 91
Joined: Tue Jul 18, 2006 10:41 am
Location: India

After Job Routine for Job Sequence

Post by theverma »

Hello Friends,

My Requirement is to send a Status message from a Job Sequence to TIVOLI(IBM Monitoring Tool).Right now i am sending the Finished Status message of the jobs(in the Job Sequence) by executing an OS command in an After-Job Subroutine.

Please suggest how I can send the Finished status of the Job Sequence.

Thanks in advance!!!
Arun Verma
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Define 'send the Finished status' or 'send a Status message from a Job Sequence'? Does that mean you need to send some kind of an email after a job completes? Or since we're talking a Scheduler, do you mean you are trying to control the exit / return status Tivoli sees?

Be more specific, explain what your requirements are, and more on what you are currently doing including this mysterious 'OS command' you are using.
-craig

"You can never have too many knives" -- Logan Nine Fingers
theverma
Participant
Posts: 91
Joined: Tue Jul 18, 2006 10:41 am
Location: India

Post by theverma »

'Send the Finished status' means that I want ot capture the Status of the Job Sequence once it geys completed.It can be Finished OK,Finished with warnings or Aborted.
I want the Job Status of the Job Sequence.

Hoping that I am Clear to you now
Thanks
Arun Verma
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, not clear yet. Capture in what sense? And then do what with this captured information?

If you are running your jobs using the dsjob command, the -jobstatus option will cause it to return the normal DataStage completion codes:

1 = Finished Ok
2 = Finished (see log)
3 = Aborted

etc. Would that help?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mike3000
Participant
Posts: 24
Joined: Mon Mar 26, 2007 9:16 am

Post by Mike3000 »

we can do the following:
- create OS script to call your main sequence;
- in this OS script we need to read 'Job status' from
DS log-file after your main sequence finishes.
- from those OS script we send message about
status that we have just read to TIVOLI

Tell me if it helps?
theverma
Participant
Posts: 91
Joined: Tue Jul 18, 2006 10:41 am
Location: India

Post by theverma »

I am using Director to Schedule my Job Sequence.I am not using any OS command to trigger the sequence.

Inside Job Sequence we have 3 Jobs(Job1,Job2,Job3)
In each Job i am using a After Job Subroutine.In that routine i am generating Job Report and then fetching out the Job Status of the current Job and sending this Job status to TIVOLI.

But in case of Job Sequence i donot have any option to attach After Job Subroutine.

Thanks
Arun Verma
Mike3000
Participant
Posts: 24
Joined: Mon Mar 26, 2007 9:16 am

Post by Mike3000 »

Create one more Seq that will call your existing Seq and
in this new Seq do what you want: call jobs, another
Seqs, scripts, check Seqs Status, etc.

Would IT help?
theverma
Participant
Posts: 91
Joined: Tue Jul 18, 2006 10:41 am
Location: India

Post by theverma »

No..I wouldn't help...!!
Arun Verma
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

One way you can do this is with a simple parent job sequence that executes your job sequence then reports its status.

Another way is via a Routine activity that captures the "interim status" of the job sequence. Read the help on DSGetJobInfo(), particularly the DSJ.JOBINTERIMSTATUS key.
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 »

theverma wrote:In that routine i am generating Job Report and then fetching out the Job Status of the current Job and sending this Job status to TIVOLI.
Again, help me out here because I don't know beans about Tivoli. I've asked this before and you don't answer - how exactly are you 'sending this job status' to Tivoli? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
theverma
Participant
Posts: 91
Joined: Tue Jul 18, 2006 10:41 am
Location: India

Post by theverma »

I am Executing an OS command for TIVOLI to send the message.
I am using an AterJob Subroutine,which gets the status of the current job from the Job Report and then executing an OS Command with the required parameters to send the Message.

I am facing problem because we donot have After-Job Subroutine kind of facility for Job Sequence.So wondering from where to fire this Routine in case of Job Sequence.

Thanks !!!
Arun Verma
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Umm... why not just use a Routine Activity (or Execute Command) stage at the end of the Sequence of jobs? :?

Inside the current job (after or inside, doesn't matter) you cannot get the 'job status' of the current job as it hasn't ended yet. If what you want is the status of the current job itself, what it *will* be assuming no other issues then you'll need to get the INTERIM status as Ray noted earlier. Read the online help, it explains the difference.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

After job subroutines are not supported in job sequences. You either need to rewrite it as a transform function, or write a transform function that calls the after job subroutine that you already have, using a CALL statement.

The Routine activity in a job sequence can only execute a transform function.
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