How to find the last link of an etl job?

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
bharathappriyan
Participant
Posts: 47
Joined: Fri Sep 23, 2005 6:01 pm

How to find the last link of an etl job?

Post by bharathappriyan »

Hi,

DataStage: 7.5 OS: Windows

Is there a way to find the last link of an ETL job?. My requirement is to find out the start time, end time, status & rows processed by an etl job present in a project. The project has around 5000 jobs. We have an routine to give the start time, end time and status. Now i have to get the rows processed. If am able to get the last link,i can pass that to DSGetLinkInfo macro to get that.

Thanks,
Bharathappriyan
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Jobs can have multiple "end" links.


Do a search for ETLstats here on the forums.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you use link naming conventions, for example naming an output link tablename_OUT, then your task will become a lot easier.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bharathappriyan
Participant
Posts: 47
Joined: Fri Sep 23, 2005 6:01 pm

Post by bharathappriyan »

Hi Ray,

80% of the jobs are using naming conventions. 20% are not.

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

Post by ray.wurlod »

Fix the 20%.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Technically, it seems to me that any stage with only an input link would be a target and thus considered as a 'last link'. And I believe that a call to DSGetStageInfo() would return that when using DSJ_LINKTYPES as the Info_Type.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

The job report XML has links defined as output or input. You need to figure out which is really output to you. The row counts are all attached to links and stages. The starting point is an input stage with only input rows. Same on the output stages with only output rows. If that makes sense. All stages with inputs and outputs are in the middle.

So you would need to process the input and outputs into lookups. Next process the rows. Put into tables and run SQL to find only inputs and only outputs. Compare to your job design.

A lot of work.
Mamu Kim
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

@chulett : If they are writing to an error/ reject target in Server jobs, it would only have an 'input' link .
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

(This is probably not helpful.)
The last link in a job is the one that was added last (most recently) to the job design, and is therefore the link with the highest internal link/pin number.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

It is like Bill Clinton says. Depends on how you define "last".
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply