Capturing the error in a file or table

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
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Capturing the error in a file or table

Post by senthilmp »

Hi,

How can i write the error we are getting in the director log into a file or table,

eg: am having a job which reads from source and inserts into a table, when some oracle error like (datatype invalid or inserted record too large) happens i want this particular error message to be captured in a file or table,

Hw it can be achieved,

Thanks in advance,
Senthil MP
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create a routine or command to read the log entry in question and write it to your file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Post by senthilmp »

ray.wurlod wrote:Create a routine or command to read the log entry in question and write it to your file. ...
Hi Ray,

thanks for the info, but can u still help me how to achieve this, am really not aware hw to achieve this.

Pls help me out

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use the log processing functions (DSGetNewestLogId(), DSGetLogSummary(), DSGetLogEntry()) in the routine or the equivalent options in the dsjob 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.
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Post by senthilmp »

Hi Ray,

Am unable to achieve this, pls explain me step by step to acheive this, i tried many ways by self reading the help document still i couldnt end up correctly, Can you pls explain me step by step for capturing the error record/warning record of the job.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Where are you doing this from, and what have you tried?

I neglected, earlier, to mention that Director has a Print option under the Project menu, and that the print dialog has a Print to File choice available. This may do it for you.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Post by senthilmp »

Am trying to do in the Datastage Designer, My aim is as follows:

Step 1) Read data from oracle source and transform it with one to one mapping and write to the target. IF any datatype mismatch or field length more than expected the entire rows will be rejected by giving a warning in director.
Step 2) I will be collecting those records rejected through outputlink.REJECTED and writing into a file/table. This all work fine.

Now what i want to do is, also attach a field with already existing field of rejection links say 'Warning Field' and this should have the particular warning message from the log.

For eg. if a record is rejected due to the warning 'Inserted value too large for column,row rejected' then this warning message should be entered in the Warning Field to the reject link along with other rejected record field

if the target table is havign Field1 with varchar2(3) and the data for this particular field from source is 'DATAST' then it will be rejected with the above said warning, now the file/table which collects the reject records should have Fiedl1 - DATAST Warning Field - Inserted Value too large for column,row rejected

This is what am trying to achieve, to be short we trying to do Bad Records Handling mechanism
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Search for post "Routine to perform the error handling". That looks more or less like your needs. stage variables can do a lot.
Kandy
_________________
Try and Try again…You will succeed atlast!!
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Post by senthilmp »

I dont want to achieve through Stage Variables, because we have many fields it will degrade the performance
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Then there is no built-in feature to achieve that :(
Kandy
_________________
Try and Try again…You will succeed atlast!!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Moderator: please move to server forum
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Post by senthilmp »

Pls can any one help me out in finding a solution for this?
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Senthil, use BASIC transformer. First of all, it is not a problem because you have features to overcome this. If you don't know how to use BASIC transformer, pls let us know so that we can help.
Kandy
_________________
Try and Try again…You will succeed atlast!!
Post Reply