Page 1 of 1

How to find the last link of an etl job?

Posted: Mon Apr 07, 2014 8:18 am
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

Posted: Mon Apr 07, 2014 12:43 pm
by PaulVL
Jobs can have multiple "end" links.


Do a search for ETLstats here on the forums.

Posted: Mon Apr 07, 2014 4:46 pm
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.

Posted: Tue Apr 08, 2014 10:57 am
by bharathappriyan
Hi Ray,

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

Thanks,
Selva

Posted: Tue Apr 08, 2014 2:05 pm
by ray.wurlod
Fix the 20%.

Posted: Tue Apr 08, 2014 3:14 pm
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.

Posted: Thu Apr 10, 2014 9:16 pm
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.

Posted: Mon Apr 21, 2014 2:19 pm
by rameshrr3
@chulett : If they are writing to an error/ reject target in Server jobs, it would only have an 'input' link .

Posted: Mon Apr 21, 2014 2:23 pm
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.

Posted: Tue Apr 22, 2014 8:08 am
by kduke
It is like Bill Clinton says. Depends on how you define "last".

Posted: Tue Apr 22, 2014 8:51 am
by chulett
Exactly. :wink: