Execute Command Activity in Sequence Job -- return value
Moderators: chulett, rschirm, roy
Execute Command Activity in Sequence Job -- return value
Hi All,
I am using an script to delete all the records in all the tables before I load them using my sequence job.So,i have used Execute Command Activity in Sequence Job first.
My requirement is i need to capture the status of my script.If it was not executed properly which means it could not delete all the records in all the tables then it shoud send out a status(return value) and that value has to be captured by my Execute Command Activity.If the return code is != 0 it should not proceed further.
I have used Return value (conditional) = 0 in the trigger but it has not served ny Purpose.i.e,Sequence Job is Proceeding further even the script is not executed Properly.
Could any one help in this regard.
Please let me know if you need any further info.
I am using an script to delete all the records in all the tables before I load them using my sequence job.So,i have used Execute Command Activity in Sequence Job first.
My requirement is i need to capture the status of my script.If it was not executed properly which means it could not delete all the records in all the tables then it shoud send out a status(return value) and that value has to be captured by my Execute Command Activity.If the return code is != 0 it should not proceed further.
I have used Return value (conditional) = 0 in the trigger but it has not served ny Purpose.i.e,Sequence Job is Proceeding further even the script is not executed Properly.
Could any one help in this regard.
Please let me know if you need any further info.
Manu
Datastage Devoloper
Datastage Devoloper
Hi all,
Thanx a lot for your Prompt reply.My Execute acivity is working fine when I have made a small change to my script.
But,I need some help in sending the exact error in mail (using Notification activity).
As of now In the mail I am getting the status of the Job but not the error(present in the log).
For example,My script (for deleting the records in the tables)has failed while deleting the records due to some problem in the Database.
But,for this I just got a mail saying the Job has failed in the subject (Which I have set).
But,when I actually looked into the error messge in the log file.Following is the Issue.
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0905N Unsuccessful execution due to resource limit being exceeded.
Resource name = "ASUTIME", limit = "000000000232" CPU seconds ("000002500000"
service units) derived from "SYSIBM.DSNRLST01". SQLSTATE=57014.
My requirement is to have the above error message as the body in the mail.
To,summarize I want to have the error message if a job fails as a part of the body in the mail along with the status of the Job.
Please let me know If I am not clear.
Thanx a lot for your Prompt reply.My Execute acivity is working fine when I have made a small change to my script.
But,I need some help in sending the exact error in mail (using Notification activity).
As of now In the mail I am getting the status of the Job but not the error(present in the log).
For example,My script (for deleting the records in the tables)has failed while deleting the records due to some problem in the Database.
But,for this I just got a mail saying the Job has failed in the subject (Which I have set).
But,when I actually looked into the error messge in the log file.Following is the Issue.
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0905N Unsuccessful execution due to resource limit being exceeded.
Resource name = "ASUTIME", limit = "000000000232" CPU seconds ("000002500000"
service units) derived from "SYSIBM.DSNRLST01". SQLSTATE=57014.
My requirement is to have the above error message as the body in the mail.
To,summarize I want to have the error message if a job fails as a part of the body in the mail along with the status of the Job.
Please let me know If I am not clear.
Manu
Datastage Devoloper
Datastage Devoloper
Can you post an example, please? In earlier versions, you got a simple status from any successful jobs but the last entry was always the failure point and included something from the job's log from what I recall.
If that truly does not work for you, you'll not be able to use the stage but will instead need to script or build a routine to call 'sendmail' or your email client of choice - that way you'll have full control over what goes where. You have no such control over the 'body text' in the stage other than the option I mentioned.
If that truly does not work for you, you'll not be able to use the stage but will instead need to script or build a routine to call 'sendmail' or your email client of choice - that way you'll have full control over what goes where. You have no such control over the 'body text' in the stage other than the option I mentioned.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers