How to pass the log event details to a 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
MOHAMMAD.ISSAQ
Participant
Posts: 78
Joined: Fri Mar 02, 2007 4:54 am
Location: CHENNAI

How to pass the log event details to a file?

Post by MOHAMMAD.ISSAQ »

I've used this command in a routine

"SummaryArray = DSGetLogSummary(JHandle, DSJ.LOGWARNING, StartTime, EndTime, MaxNumber)"

It's working fine.The event details are stored in "SummaryArray", i want to pass the contents of "SummaryArray" to a file in Unix.

I've used the command "cat SummaryArray > Log_Warn.txt ".
But it's throwing an error.

How do i pass the contents of "SummaryArray" to a file through routines?

Pls help me out...
Waiting for ur valuable inputs...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You could do it directly with

Code: Select all

OPENSEQ '/path/to/file.txt' TO OutFilePtr THEN WEOFSEQ(OutFilePtr) ELSE NULL
WRITESEQ SummaryArray TO OutFilePtr ELSE CALL DSLogFatal('Bad write','')
CLOSESEQ OutFilePtr
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post by AmeyJoshi14 »

Hello!

You can use the 'dsjob' command as well to get your results! :wink:

Code: Select all

dsjob -logsum -type STARTED -max 2 Project_name Job_name 2>/dev/null > Log_Warn.txt 
cat Log_Warn.txt 
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
Post Reply