Execute Command Activity in Sequence Job -- return value

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Manu1
Participant
Posts: 36
Joined: Mon Aug 31, 2009 5:51 am
Location: Hyderabad

Execute Command Activity in Sequence Job -- return value

Post by Manu1 »

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.
Manu
Datastage Devoloper
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you certain you are setting your script's exit status properly? Can you post the log entry from your Execute Command stage - it should show the output and the 'reply', which is the Return Code.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kiran259
Participant
Posts: 48
Joined: Thu Aug 16, 2007 11:17 pm
Location: United States
Contact:

Post by kiran259 »

Why not "Before Job Routine" ?
Kiran Vaduguri

As soon as the fear approaches near, attack and destroy it.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

How about using "OK" trigger?
SHARAD123
Premium Member
Premium Member
Posts: 54
Joined: Wed Jan 09, 2008 12:05 am

Post by SHARAD123 »

Hi,

Is the individual job completing successfully or finishing with a log in case of an error?

If the individual job exits with a log the job run status can be captured to identify the success of the script.
222102
Manu1
Participant
Posts: 36
Joined: Mon Aug 31, 2009 5:51 am
Location: Hyderabad

Post by Manu1 »

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.
Manu
Datastage Devoloper
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Did you try enabling the 'Include job status in email' option? That should pull that error from the log into the email body.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Manu1
Participant
Posts: 36
Joined: Mon Aug 31, 2009 5:51 am
Location: Hyderabad

Post by Manu1 »

chulett wrote:Did you try enabling the 'Include job status in email' option? That should pull that error from the log into the email body. ...
I am getting only the status in the mail when this option was enabled..........not the error.......
Manu
Datastage Devoloper
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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.
-craig

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