Capturing Event Detail Message
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 40
- Joined: Tue May 18, 2004 10:51 pm
Capturing Event Detail Message
HI, I was wondering if I could capture the Message from Event Detail WIndow from Director's log, so that I could use it in the job and send that message to a table.
Thanks in Advance.
Regards
James
Thanks in Advance.
Regards
James
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Can you clarify whether you want windows event viewer or DataStage job log to be captured.
If you want DataStage job log, you can obtain it by reading the corresponding RT_LOG file.
If you want Windows Event viewer log, you can ask the administrator to write it in a file and scan / monitor the file from DataStage. I recollect having a command level interface for this that I accessed from DataStage.
If you want DataStage job log, you can obtain it by reading the corresponding RT_LOG file.
If you want Windows Event viewer log, you can ask the administrator to write it in a file and scan / monitor the file from DataStage. I recollect having a command level interface for this that I accessed from DataStage.
JamesV,
from within DataStage you can write a Routine or Function that access the published routines to get this information. First use a call of to attach to your job, then you can use the DSGetLogSummary, DSGetLogEntry, or DSGetNewestLogId functions to retrieve the details on the entry in question. The documentation describes which options you have for these calls in detail.
from within DataStage you can write a Routine or Function that access the published routines to get this information. First use a call of
Code: Select all
MyJob = DSAttachJob("YourJobName",DSJ.ERRWARN)
-
- Participant
- Posts: 40
- Joined: Tue May 18, 2004 10:51 pm
In my job I'm sending all the rejected reocrds to a procedure in which I would like to capture the warning message, this should happen at record level, like using a "outputlink.DBSCODE, which gets me only the DBSCODE but I need the whole message", for example this is the warning message I'd like to send to the output (procedure) link "XFM_Product:ORA-01400: cannot insert NULL into ("GPI"."T0013_PRODUCT"."UNITS_PER_PACKAGE")" this is the warning message from the log file. I want to use this as it is.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 40
- Joined: Tue May 18, 2004 10:51 pm
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 40
- Joined: Tue May 18, 2004 10:51 pm
I could use this function only in the JOB CONTROl, but I want to use it in the same job that throws the warnings.
it's like I need to get the message when it logs it in the Director.
I'm sorry If I'm being a pain in the neck. but please suggest me how to do it.
Thanks
your help is really appreciated.
it's like I need to get the message when it logs it in the Director.
I'm sorry If I'm being a pain in the neck. but please suggest me how to do it.
Thanks
your help is really appreciated.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
If you download EtlStats from my tips page or from ADN then all you need is to run GenHtmlJobLog and give it the job name. It will email a web page with the log in an html table. Looks real nice. Super easy.
It would be easy to change this into a source query in a job and dump the log to a flat file or a table.
It would be easy to change this into a source query in a job and dump the log to a flat file or a table.
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There is a function DSGetLogEntry for capturing the detail of a logged event. This requires the Event ID (a sequential number) of the event in question. You can determine the Event ID, for example by calling the function DSGetNewestLogId (which can filter on "warning" type).
You can find out more in on-line help (from Manager or Designer) or in the DataStage BASIC manual.
You can find out more in on-line help (from Manager or Designer) or in the DataStage BASIC manual.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 40
- Joined: Tue May 18, 2004 10:51 pm
Hi JAMES,
version:6.0
server:unix
Could you please post your code as i need the same thing. Right now i am using DSLOGSUMMARY to capture the log and send it in email, but as you know It won't give you the more detailed description of the warnings or errors( i mean as you see in event detail window) . In 6.0 i don't see any DSlogdetail function as well.
As most of the people understand my question if not more description what exactly i want:
example: if the error is beacause of Database user name is wrong. what i am getting is sql connection failed as you see in the log. But in the director if you click on the message the event detail message will tell you every thing about what you have entered in the user name field. I want that information too.
I mean whatever you see in RT_LOGnnn table. I know i can get the log from select * from rt_lognnn statement, but my jobcontrol will send you the email of the log as soon as the job is finished( i.e if possible i need the code in the same jobcontrol).
If anybody have any ideas please let me know
Thanks
sandeep
version:6.0
server:unix
Could you please post your code as i need the same thing. Right now i am using DSLOGSUMMARY to capture the log and send it in email, but as you know It won't give you the more detailed description of the warnings or errors( i mean as you see in event detail window) . In 6.0 i don't see any DSlogdetail function as well.
As most of the people understand my question if not more description what exactly i want:
example: if the error is beacause of Database user name is wrong. what i am getting is sql connection failed as you see in the log. But in the director if you click on the message the event detail message will tell you every thing about what you have entered in the user name field. I want that information too.
I mean whatever you see in RT_LOGnnn table. I know i can get the log from select * from rt_lognnn statement, but my jobcontrol will send you the email of the log as soon as the job is finished( i.e if possible i need the code in the same jobcontrol).
If anybody have any ideas please let me know
Thanks
sandeep
-
- Participant
- Posts: 40
- Joined: Tue May 18, 2004 10:51 pm
Sandeep,
I've used this code which gives me 2 entries, put 0 instead of 2 which gives you all the log, be careful in using this option, it limits the no. of events you can get from the log.
James
Code: Select all
DSGetLogSummary (DSJ.ME, DSJ.LOGWARNING, DSJobStartTimestamp, DSGetJobInfo (DSJ.ME, DSJ.JOBEOTTIMESTAMP), 2)
James