How to capture the message from Director Log?

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
Nripendra Chand
Premium Member
Premium Member
Posts: 196
Joined: Tue Nov 23, 2004 11:50 pm
Location: Sydney (Australia)

How to capture the message from Director Log?

Post by Nripendra Chand »

In event detail section of Log info i can see the appropriate message. how can i capture this message on server jobs? I want to capture only the message.

-Nripendra
vinodlakshmanan
Participant
Posts: 82
Joined: Wed Jul 14, 2004 7:21 am
Location: India

Post by vinodlakshmanan »

If you want to do it using Unix, you can do it using the dsjob command. You will need the log ID for this. You can get this using the -logsum or -lognewest option. Using the log ID, you can get the message using the -logdetail option.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Perhaps the "FAQ Man" should put together one on this topic. :wink: It sure seems to be a popular topic lately!
-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 »

I still do not get why people are doing all this in a routine. Write a job. Start with a UV stage. Output to a sequential file or a target table. I prefer the later. Here is the SQL for the UV stage.

Code: Select all

select EVAL "'#JobName#'" AS JOB_NAME, TIMESTAMP, SEVERITY, FULL.TEXT from RT_LOG#JobNo# where EVAL "@ID" NOT LIKE '//%' order by TIMESTAMP;

I really think a lot of this is easier in jobs. All you need to do is write a batch job to feed the job names and job numbers into the parameters for JobName and JobNo. Just a few lines of code. You will need to create the target table.
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

The key to the target table is JobName and TIMESTAMP. I do row counts this way.

I would skip multiple instance jobs unless you know the InvocationId. InvocationId is stored in field 7 of the log. Your SQL will change too.
Mamu Kim
Post Reply