How to collect job status

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

How to collect job status

Post 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.
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

Yes, searh in this forum and Ray answered this questions many times
Thanks,
Chad
__________________________________________________________________
"There are three kinds of people in this world; Ones who know how to count and the others who don't know how to count !"
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post 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.
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

use keywords "job stats" or ETLstats
Thanks,
Chad
__________________________________________________________________
"There are three kinds of people in this world; Ones who know how to count and the others who don't know how to count !"
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post 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?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post by sjordery »

Ok is there any other option to collect the job statistics in the unix script.
Please suggest.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use dsjob with the -report option.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post by sjordery »

thanks ray.Can you please send me the exact syntax I have to specify in the script .
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply