Page 1 of 1

To extract the error messages from the log file.

Posted: Mon Jan 09, 2006 1:22 pm
by vimali balakrishnan
Hi,

I'm trying to extract the error messages from the log file of a job to a sequential file.I'm using the DSGetLinkInfo function available in datastage.The syntax of which is DSGetLinkInfo(DSJ.ME,'Oracle_OCI_8','DSLink9',DSJ.LINKLASTERR),where
Oracle_OCI_8 is the stage name,DSLink9 is the link name.But the result of this function is only the DBMS CODE(Error code).It doesn't return the actual error message.For example if the error is, ORA-01722: invalid number.The DSGetLinkInfo function returns only the code,ORA-01722 whereas the actual error message is ORA-01722: invalid number.It would be of great help,if someone can suggest me a solution for this.

Regards,
Vimali.

Posted: Mon Jan 09, 2006 1:49 pm
by chulett
You are mixing up your processes. DSGetLinkInfo doesn't get information from the job's log but rather from the job itself. It doesn't get all errors, just the last one. And, as you've noticed, it won't get the text of the message only the error number itself.

Why not put a 'reject' link against the OCI stage? That would be the normal mechanism whereby all errors are sent to a sequential file. Only thing there too is the fact that the error message you want won't be there.

The only way I've found to get that is to pull the error messages from the job log itself after the job has finished as it has the text of the message as well as the error number. This would typically be accomplished using the dsjob command and has been discussed many, many times in this forum. Or you could write a DS job to read the logs as they are 'just' hashed files in the project.

And you might want to rethink those object names in your job: Oracle_OCI_8 and DSLink9? Not very informative. :wink:

Posted: Thu Jan 12, 2006 11:30 am
by rajeevs
try the following:
DSGetLogSummary
DSGetlogEntry