Page 1 of 1

How to collect job status

Posted: Thu May 10, 2007 7:40 am
by sjordery
Hi all,

I have a job which is sending data from a file to target.
After the job run I need to maintain a stastics table which should contain the following information.

1-file name
2-job name
3-start date
4-no of records processed
5-no of records rejected

can anybody suggest how to acheive this.

Posted: Thu May 10, 2007 8:05 am
by mctny
Yes, searh in this forum and Ray answered this questions many times

Posted: Thu May 10, 2007 9:17 am
by sjordery
Hi Cetin,

Thanks.
How ever I tried to search the forum,but nt able to get the exact solution.
Can you please send me the exact search keyword for this.

Posted: Thu May 10, 2007 9:26 am
by mctny
use keywords "job stats" or ETLstats

Posted: Fri May 11, 2007 7:16 am
by sjordery
Hi I tried to collect the job stastics using a script.

This is the script which I have used to run the job and collect one stastics no of rows passing through a link.

#! /usr/bin/sh
dshome=`cat /.dshome`;
export dshome
PATH=$PATH:$dshome/lib;
export PATH
. $dshome/dsenv
dsjob -run Phase1 test_job
link = DSGetLinkInfo(test_job, "Transformer_2","DSLink4",DSJ.LINKROWCOUNT)

echo $link

while running the script I am geting the error mentioning invalid command.

can anybody suggest?

Posted: Fri May 11, 2007 7:24 am
by DSguru2B
sjordery wrote: link = DSGetLinkInfo(test_job, "Transformer_2","DSLink4",DSJ.LINKROWCOUNT)
Thats a DataStage API function. It will not work at the OS level. Read about DSGetLinkInfo in DataStage help.
Search the archives on how to use it in a basic batch job or routine.

Posted: Fri May 11, 2007 7:41 am
by sjordery
Ok is there any other option to collect the job statistics in the unix script.
Please suggest.

Posted: Fri May 11, 2007 8:12 am
by DSguru2B
Ofcourse there is. You will have to spit out the entire log file to a text file and then use your unix scripting skills to parse through the log file to get all the information you need.

Posted: Fri May 11, 2007 3:23 pm
by ray.wurlod
Use dsjob with the -report option.

Posted: Sun May 13, 2007 10:28 pm
by sjordery
As I have mentioned I also have to collect the no of rows passing through a particular link plus some other statistics like start date,end date of the job.
So will this -report option in dsjob help me to collect the above stastics about the job please suggest?

Posted: Sun May 13, 2007 10:59 pm
by ray.wurlod
It will help, as will the -stageinfo and -linkinfo options. To use these effectively in a script you probably also need the -lstages and -llinks options also.

Posted: Sun May 13, 2007 11:46 pm
by sjordery
thanks ray.Can you please send me the exact syntax I have to specify in the script .

Posted: Mon May 14, 2007 1:06 am
by ray.wurlod
No. Because I would have to guess, even what scripting language you are using.

Type dsjob alone to get the overall syntax. Then type dsjob with any of the options to get more information, for example dsjob -linkinfo to learn the remainder of the syntax to be used with this particular option.

You need to build a loop based on the output of -lstages to iterate through the stages, then an inner loop based on the output of -llinks to get the values you need from the -linkinfo option. Within the loop you need to parse out the values returned by that option.

It would be so much easier to use ETLstats.