capture warning message

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

lakshya
Participant
Posts: 19
Joined: Fri Jan 21, 2005 2:39 pm

capture warning message

Post by lakshya »

hi,
can anyone tell me how to capture a warning message from a job running in a sequence....without checking the log file.

Thanks
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

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,
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
Image
lakshya
Participant
Posts: 19
Joined: Fri Jan 21, 2005 2:39 pm

Post by lakshya »

hi,
i want to know what the warning message is .....i mean like writing the warning message to a sequential file...

thanks
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Read from the hash-file RT_LOGnnn where nnn is the job number.
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Post by naren6876 »

HI,

HOW CAN I READ THIS RT_LOGnnn FILE?.
HOW CAN I IDENTIFY THE CORRESONDING JOBS RT_LOGnnn FILE?
THANKS,
NAREN
Sainath.Srinivasan wrote:Read from the hash-file RT_LOGnnn where nnn is the job number.
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi Naren,

In RT_LOGnnn, nnn is the job number. You can get the job number using the following query

SELECT JOBNO FROM DS_JOBS WHERE NAME='jobname'

You can describe the DS_JOBS hash file using LIST DICT DS_JOBS.

HTH
Rich
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

By-the-way, the query is to be run in Universe (uv or dssh or uvsh)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or in the Administrator. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

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 '/%'
Mamu Kim
JeanPierreHaddad
Participant
Posts: 18
Joined: Mon Nov 25, 2002 3:23 am
Location: Switzerland

Re: capture warning message

Post by JeanPierreHaddad »

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
rajiivnb
Participant
Posts: 77
Joined: Fri Sep 10, 2004 8:38 am
Location: India

Capture Warning message

Post by rajiivnb »

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.
lakshya
Participant
Posts: 19
Joined: Fri Jan 21, 2005 2:39 pm

Hi

Post by lakshya »

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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
lakshya
Participant
Posts: 19
Joined: Fri Jan 21, 2005 2:39 pm

Hi

Post by lakshya »

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.

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.
Post Reply