Exception handling in datastage

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
khanparwaz
Participant
Posts: 60
Joined: Tue Jul 12, 2005 3:34 am

Exception handling in datastage

Post by khanparwaz »

Can we do exception handling in datastage?
By this I mean can we catch any datastage error and write it into a file.
Say for example if I am creating a file and datastage is not able to create the file due to some reason. In this case instead of datastage job failing I want to capture this error in the same job and write it into a log file.
Is it possible ?

Thanks in advance...
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Yes you can. Capture the error log and write to file.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
khanparwaz
Participant
Posts: 60
Joined: Tue Jul 12, 2005 3:34 am

Post by khanparwaz »

JoshGeorge wrote:Yes you can. Capture the error log and write to file.
How can we do this ?
Can we write user defined messages ?
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Check out this link:
http://dsxchange.com/viewtopic.php?p=23 ... ec4#236044


User defined messages takes it to a broader level. You will have to state what all are the expected warning/errors you like to define under this.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Exception handling in datastage

Post by chulett »

khanparwaz wrote:Can we do exception handling in datastage?
By this I mean can we catch any datastage error and write it into a file.
Say for example if I am creating a file and datastage is not able to create the file due to some reason. In this case instead of datastage job failing I want to capture this error in the same job and write it into a log file.
Is it possible ?
No. Most errors of the kind you mentioned are not 'interceptable' and the DataStage job will fail regardless of your desires. And those messages will automatically be written to the log.

JoshGeorge is answering a different question - how to farm error messages from the job's log after it completes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Re: Exception handling in datastage

Post by JoshGeorge »

khanparwaz wrote:Can we do exception handling in datastage?
...
Yes you can. In programatic terms, call all your jobs from a squence and you handle all the job aborts and warnings there.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Re: Exception handling in datastage

Post by JoshGeorge »

khanparwaz wrote:Say for example if I am creating a file and datastage is not able to create the file due to some reason. In this case instead of <b>datastage job failing </b> I want to capture this error in the same job and write it into a log file.
Is it possible ?
Well I missed the example :) What Craig said on that is right.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Post Reply