Hi
I need to trap the status of execute Activity (shell script in my case) in case of failure and then mail out the status.
Using Datastage Job control can we trap the Status of the Shell and the use DSSendMail to mail the log for that execute Activity.
I think DSGetJobInfo would not get me the information. Could if please suggest what to use in this case?
Any help or tips are most welcome.
Tracking Status of Execute Activity
Moderators: chulett, rschirm, roy
Tracking Status of Execute Activity
Avishek Mukherjee
Data Integration Architect
Chicago, IL, USA.
Data Integration Architect
Chicago, IL, USA.
DSguru2B wrote:A simple way is to have another shell to check the result of the first shell. If the result is created or valid meaning that it ran, then with conditions you can just mail out the status.
I need it to be handled together with the datastage jobs....
Say I have the Job Sequencer as
Code: Select all
Shell--yes->DS job--yes-->DS job--yes-->Shell --yes-->Email
! ! ! !
! ! ! !
V V V V
********** S E Q U E N C E********************* -----> Email
I need the same email (Job control routine) to handle both success and failure.
Avishek Mukherjee
Data Integration Architect
Chicago, IL, USA.
Data Integration Architect
Chicago, IL, USA.
Hi
Another question:
I saw that we have-
#ExecuteActivityName.$CommandName#
#ExecuteActivityName.$CommandOutput#
#ExecuteActivityName.$ReturnValue#
Can we somehow use them in the job control routine to send out success or failure email.
Say I am using the folowing code to get the current job name from where the routine is called:
Should I get the Execute Activity name if it calls my job control routine to send out the email. Also should all the DSAttachJob and DSGetJobInfo work for Execute Activity??
Please help![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
Another question:
I saw that we have-
#ExecuteActivityName.$CommandName#
#ExecuteActivityName.$CommandOutput#
#ExecuteActivityName.$ReturnValue#
Can we somehow use them in the job control routine to send out success or failure email.
Say I am using the folowing code to get the current job name from where the routine is called:
Code: Select all
* -----------------------------------------------------------------
* Get the Job name from the called Job
* -----------------------------------------------------------------
JobName= DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
then attach the job:
AttachedJob = DSAttachJob(JobName, DSJ.ERRNONE)
and another to get status:
Status= DSGetJobInfo(AttachedJob,DSJ.JOBSTATUS)
Should I get the Execute Activity name if it calls my job control routine to send out the email. Also should all the DSAttachJob and DSGetJobInfo work for Execute Activity??
Please help
![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
Avishek Mukherjee
Data Integration Architect
Chicago, IL, USA.
Data Integration Architect
Chicago, IL, USA.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I need the same email (Job control routine) to handle both success and failure.
Write it as a transform function and invoke it through a Routine activity.
Should I get the Execute Activity name if it calls my job control routine to send out the email?
No. Use separate Notification activities, or provide a hard-coded argument to the routine activity.
Also should all the DSAttachJob and DSGetJobInfo work for Execute Activity??
No. These are intrinsic to the product, and can be invoked only from DataStage BASIC (that is, within a Routine). Execute Command activity invokes an operating system command.
Write it as a transform function and invoke it through a Routine activity.
Should I get the Execute Activity name if it calls my job control routine to send out the email?
No. Use separate Notification activities, or provide a hard-coded argument to the routine activity.
Also should all the DSAttachJob and DSGetJobInfo work for Execute Activity??
No. These are intrinsic to the product, and can be invoked only from DataStage BASIC (that is, within a Routine). Execute Command activity invokes an operating system command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.