Page 1 of 1

Capturing the error in a file or table

Posted: Thu Nov 06, 2008 1:59 am
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

Posted: Thu Nov 06, 2008 7:18 am
by ray.wurlod
Create a routine or command to read the log entry in question and write it to your file.

Posted: Thu Nov 06, 2008 7:20 am
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

Posted: Thu Nov 06, 2008 7:28 am
by ray.wurlod
Use the log processing functions (DSGetNewestLogId(), DSGetLogSummary(), DSGetLogEntry()) in the routine or the equivalent options in the dsjob command.

Posted: Sat Dec 13, 2008 9:25 am
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.

Posted: Sat Dec 13, 2008 3:03 pm
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.

Posted: Thu Dec 18, 2008 8:47 am
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

Posted: Thu Dec 18, 2008 8:58 am
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.

Posted: Fri Dec 19, 2008 8:32 am
by senthilmp
I dont want to achieve through Stage Variables, because we have many fields it will degrade the performance

Posted: Fri Dec 19, 2008 8:48 am
by kandyshandy
Then there is no built-in feature to achieve that :(

Posted: Fri Dec 19, 2008 2:08 pm
by ray.wurlod
Moderator: please move to server forum

Posted: Sat Dec 20, 2008 12:42 am
by senthilmp
Pls can any one help me out in finding a solution for this?

Posted: Sat Dec 20, 2008 11:26 am
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.