capture warning message
Moderators: chulett, rschirm, roy
capture warning message
hi,
can anyone tell me how to capture a warning message from a job running in a sequence....without checking the log file.
Thanks
can anyone tell me how to capture a warning message from a job running in a sequence....without checking the log file.
Thanks
Hi,
triggers will get hte knowledge of a warning or warnings being written to the log file, do you need to know the warning's message as well?
I guess a job report would give some relevantinfo.
but the real question as we many a time say: what are you trying to acomplish???
if we know that we might give a better answer.
IHTH,
triggers will get hte knowledge of a warning or warnings being written to the log file, do you need to know the warning's message as well?
I guess a job report would give some relevantinfo.
but the real question as we many a time say: what are you trying to acomplish???
if we know that we might give a better answer.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
You could do it in a routine or job as well. Lots of routines posted. To do this in a job, you would need to parameterize the job number. You have to use a UV stage to go against the repository files. Importing the metadata is tricky as well. You need to do a q-pointer. Ray will explain.
UV stage
SELECT * FROM RT_LOG#JobNo#;
Dump it into a table or flat file. You probably want to exclude the keys that start with "/" or "\". I think only the slash records exist in the log files.
Add:
WHERE EVAL "@ID" NOT LIKE '/%'
UV stage
SELECT * FROM RT_LOG#JobNo#;
Dump it into a table or flat file. You probably want to exclude the keys that start with "/" or "\". I think only the slash records exist in the log files.
Add:
WHERE EVAL "@ID" NOT LIKE '/%'
Mamu Kim
-
- Participant
- Posts: 18
- Joined: Mon Nov 25, 2002 3:23 am
- Location: Switzerland
Re: capture warning message
Hello
May I offer you the routine I wrote? It even formats the message with "\n" end of line. I use this message in an email sent to the operator to keep him busy at home during the long sleepless nights of winter.
Jean-Pierre
==========================================
Parameters: JobName, EventType
==========================================
$INCLUDE DSINCLUDE JOBCONTROL.H
$INCLUDE UNIVERSE.INCLUDE ODBC.H
** Check if the job is the current one. In this case do not try to attach but use DSJ.ME
ThisJobName= DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
If ThisJobName<>JobName Then
JobHandle = DSAttachJob(JobName, DSJ.ERRFATAL)
End Else
JobHandle=DSJ.ME
End
StartDate = DSGetJobInfo (JobHandle, DSJ.JOBSTARTTIMESTAMP)
SummaryArray = DSGetLogSummary(JobHandle,EventType,StartDate,"9999-12-31", 0)
Answer=""
NLines=0
Loop
Str = Field(SummaryArray,@FM,NLines+1)
If Str<>"" Then
NLines=NLines+1
EventId=Field(Str,"\",1)
TimeStamp=Field(Str,"\",2)
EventMessage=Field(Str,"\",6)
Answer:=EventId:" ":TimeStamp:" ":EventMessage:"\n"
End
Until Str=""
Repeat
Answer=OConv(Answer,"MCP")
Loop
I= Index(Answer,"'",1)
If I>0 Then Answer=Answer[1,I-1]:Answer[I+1,Len(Answer)]
Until I=0
Repeat
Ans=Answer
May I offer you the routine I wrote? It even formats the message with "\n" end of line. I use this message in an email sent to the operator to keep him busy at home during the long sleepless nights of winter.
Jean-Pierre
==========================================
Parameters: JobName, EventType
==========================================
$INCLUDE DSINCLUDE JOBCONTROL.H
$INCLUDE UNIVERSE.INCLUDE ODBC.H
** Check if the job is the current one. In this case do not try to attach but use DSJ.ME
ThisJobName= DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
If ThisJobName<>JobName Then
JobHandle = DSAttachJob(JobName, DSJ.ERRFATAL)
End Else
JobHandle=DSJ.ME
End
StartDate = DSGetJobInfo (JobHandle, DSJ.JOBSTARTTIMESTAMP)
SummaryArray = DSGetLogSummary(JobHandle,EventType,StartDate,"9999-12-31", 0)
Answer=""
NLines=0
Loop
Str = Field(SummaryArray,@FM,NLines+1)
If Str<>"" Then
NLines=NLines+1
EventId=Field(Str,"\",1)
TimeStamp=Field(Str,"\",2)
EventMessage=Field(Str,"\",6)
Answer:=EventId:" ":TimeStamp:" ":EventMessage:"\n"
End
Until Str=""
Repeat
Answer=OConv(Answer,"MCP")
Loop
I= Index(Answer,"'",1)
If I>0 Then Answer=Answer[1,I-1]:Answer[I+1,Len(Answer)]
Until I=0
Repeat
Ans=Answer
Capture Warning message
Hi Lakshya,
If u want to have it in a sequenctail means.. my suggestion is to give a reject file with the job itself,
say if ur target stage is a odbc stage, with name Target23. In the transformer previous to the target23, have another link for the reject file. Iin the reject file link constraint, check the reject option. and in the reject file have a column like sampleerrorfield varchar(1000) and a column from the source. in the sampleerrorfield derivation give, target23.LASTERR. S
This wil do. u will get the error message with the column from the source also. This is to get from the job itself.
If u want to have it in a sequenctail means.. my suggestion is to give a reject file with the job itself,
say if ur target stage is a odbc stage, with name Target23. In the transformer previous to the target23, have another link for the reject file. Iin the reject file link constraint, check the reject option. and in the reject file have a column like sampleerrorfield varchar(1000) and a column from the source. in the sampleerrorfield derivation give, target23.LASTERR. S
This wil do. u will get the error message with the column from the source also. This is to get from the job itself.
Hi
The actual problem is....I have lot of sequences to run and each sequence inturn has multiple jobs.If a job fails , the sequence aborts....when there is a warning it just moves to run the next job in the sequence.As there are over 200 jobs in the sequences,i dont want to go to each and every log to find if there are any warnings....I wanted to find a way to capture these warning messages,if any, when these 200 jobs are run instead of checking the logs.Is there a way to capture these warnings when all the sequences are run?
Thanks and thanks for all the previous responses too.
Thanks and thanks for all the previous responses too.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Create additional triggers (output links) on Job Activities, triggered by the job issuing warnings or failing. Direct these links to activities that perform your recording, perhaps a routine activity invoking the routine UtilityWarningToLog, perhaps a notification activity, perhaps both.
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.
Hi
Hi all,
The job in a sequence has warnings only.... and the sequence finishes successfully.Can I attach a E-Mail notification activity to the end of the sequence and instead of getting all the details about all the jobs,can I only get the warning messages e-mailed .From the documentation I have read about the dssendmail_template.txt.....but I couldnt find it on my system.Can anyone tell me where i can find it and what changes should i make in the template in order to capture only the warning messages.
Thanks
Lakshya
The job in a sequence has warnings only.... and the sequence finishes successfully.Can I attach a E-Mail notification activity to the end of the sequence and instead of getting all the details about all the jobs,can I only get the warning messages e-mailed .From the documentation I have read about the dssendmail_template.txt.....but I couldnt find it on my system.Can anyone tell me where i can find it and what changes should i make in the template in order to capture only the warning messages.
Thanks
Lakshya
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
dssendmail_template.txt is in the project directory on the server.
You want to customise what DataStage does out of the box; you will need probably to create a job or routine to extract the warnings from the log; for example using a query constrained on severity code.
You want to customise what DataStage does out of the box; you will need probably to create a job or routine to extract the warnings from the log; for example using a query constrained on severity code.
Code: Select all
SELECT "TIMESTAMP", "FULL.TEXT" FROM RT_LOGnn WHERE "TYPE" = 2 AND "TIMESTAMP" > '0';
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.