How to capture warnings from Log

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
dslearner
Premium Member
Premium Member
Posts: 67
Joined: Thu May 26, 2005 3:09 am

How to capture warnings from Log

Post by dslearner »

HiAll,

Iam new to PX.

I have a requirement that I have to write all the warning messages into sequential file of given path.
This I did in server through Before/After routines.
Now I have the same requirement in PX,is there any way to capture warnings from log file write it into a sequential file.
Or else shall i use same basic routine in PX also,I think It reduces the performence.

And in documentation i found that the server container can be run on SMP systems only,Is tyhere any restriction like this for routines.

Any thougths.

Thanks in advance.

Dslearner
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Parallel jobs can use the same before/after routines as server jobs with the same performance on those routines.
ashwin2912
Participant
Posts: 57
Joined: Wed Jan 26, 2005 10:22 pm
Location: India

Post by ashwin2912 »

You can call below script in your after job subroutine for capturing Warnings from Director Log in a text file

Code: Select all

. $DSHOME/dsenv
PROJDIR=<YOUR PROJECT DIRECTORY>
cd $PROJDIR

JOBNO=`$DSBIN/uv "select * from DS_JOBS where NAME='<JOB NAME>';" |grep No.......... | awk '{print $2}'`

$DSHOME/bin/uv "select TIMESTAMP, SEVERITY, FULL.TEXT from RT_LOG$JOBNO where SEVERITY = 'Warning' AND EVAL \"@ID\" NOT LIKE '//%' AND @ID >= CAST(EVAL \"FIELD(TRANS('RT_LOG$JOBNO','//JOB.STARTED.NO',1,'X'), @SVM, 1)\" AS DECIMAL) order by @ID;" > <YOUR LOG FILE>
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi,
I have the same req in server jobs, I need to capture warnings if any and send it to an email rather than a test file.
How do I do that.
Thanks,
ashwin2912
Participant
Posts: 57
Joined: Wed Jan 26, 2005 10:22 pm
Location: India

Post by ashwin2912 »

vinaymanchinila wrote:Hi,
I have the same req in server jobs, I need to capture warnings if any and send it to an email rather than a test file.
How do I do that.
Thanks,
In a job sequence; you can call the above script using "ExecCommand" stage and use a "Email Notification" stage for email. (You can attach the text file produced from the script as attachment to the email)
Ashwin
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi Ashwin,
Thanks for your time, when I open the "Execute_Command" stage , int he second tab, I have "COmand:" which when I select is opening like a windows explorer, where should I stick this script in?

Also when I mention the PROJDIR=<YOUR PROJECT DIRECTORY>
should I use the / or \.

Thanks a bunch
ashwin2912
Participant
Posts: 57
Joined: Wed Jan 26, 2005 10:22 pm
Location: India

Post by ashwin2912 »

vinaymanchinila wrote:Hi Ashwin,
Thanks for your time, when I open the "Execute_Command" stage , int he second tab, I have "COmand:" which when I select is opening like a windows explorer, where should I stick this script in?

Also when I mention the PROJDIR=<YOUR PROJECT DIRECTORY>
should I use the / or \.

Thanks a bunch
In Unix it is /

The stuff you need to fill in/pass as parameters are:
<YOUR PROJECT DIRECTORY>
<JOB NAME>
<YOUR LOG FILE>
Ashwin
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

Ensure that $DSHOME & $DSBIN variables defined in the Environment variables of the project or the dsenv file.

Regards
Saravanan
Post Reply