To extract the error messages from the log file.

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
vimali balakrishnan
Participant
Posts: 60
Joined: Mon Dec 27, 2004 3:38 am

To extract the error messages from the log file.

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

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
rajeevs
Participant
Posts: 14
Joined: Thu Jan 12, 2006 10:42 am

Post by rajeevs »

try the following:
DSGetLogSummary
DSGetlogEntry
Post Reply