DSJOB getting details of Warnings / Fatals

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
hassers
Participant
Posts: 14
Joined: Thu Dec 11, 2003 11:34 am
Location: Chester, UK

DSJOB getting details of Warnings / Fatals

Post by hassers »

I'd be very grateful for advice

Have created a UNIX script that runs our DataStage jobs.
After the JOB has run check the log file for either Warning or Fatal messages.

strConnect="$DSBin/dsjob -server 127.0.0.1 -user $DStageID -password $DStagePASS "

$strConnect -logsum -type WARNING $DSProject $jobname > $jobDSlogWarning
$strConnect -logsum -type FATAL $DSProject $jobname > $jobDSlogFatal


Problem is that the above looks at the logs for all runs of the job and not just the last. To get around this I clear the log after each run, but this is not ideal.

Is there a way to pick-up the log output from the last run?

THANKS
Thanks

Steve
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The command line interface doesn't give you that option, but it is available in the routines, you can get the most recent run information from DSGetJobInfo() and use that time value to get the appropriate entries via DSGetLogSummary().
hassers
Participant
Posts: 14
Joined: Thu Dec 11, 2003 11:34 am
Location: Chester, UK

Post by hassers »

Thanks for that.

However, I need to put this into a UNIX batch script running overnight.

Could anyone suggest a way I can link dsjob - lognewest giving the newest log with dsjob - logsum so I can pull the latest log.

I'm NOT a shining star on UNIX scripting so am very grateful for any advice.
Thanks

Steve
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just because you need it in a file doesn't mean you have to use UNIX scripting to get it. You could - more easily in my opinion - create a server job to do this task.

With -lognewest you should be able to filter on control messages and identify the newest "job started" message. You can extract the timestamp from that event (-logdetail) and use it to filter -logsum request.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hassers
Participant
Posts: 14
Joined: Thu Dec 11, 2003 11:34 am
Location: Chester, UK

Post by hassers »

Thanks for the information.

I'm creating a test script to see how to complete this.
Also thought of running -lognewest before and after job and picking up the range.
Thanks

Steve
Post Reply