SOURCE AND TARGET STAGE COUNT

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
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

SOURCE AND TARGET STAGE COUNT

Post by aschindler »

Hi,

I need to get the link count for source and target for my jobs,i'm able to get source count using DSGetLinkInfo,since DSGetLinkInfo will always return the outgoing link count for a particular stage,its giving target stage count as 0 as target stage is last stage in my job.

source count is the outgoing link count from source stage,but for target that is the last stage.

so i need to get incoming link count to the target stage.

Please let me know how get the target count.
Cheers,
Schindler
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

The input link to your target stage will be the output link to some stage, right? Pass the name of the penultimate stage that feeds your target as the 'Stage Name'.
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use consistent link naming conventions, then you can interrogate the link row counts using a single generic routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

Post by aschindler »

Is there any other option available ,since i can't hardcode the penultimate stage manually as there are more no.of jobs and also my src and tgt stage names are identical for all jobs ie.., src stage name starts with SRC and target with TGT.

so it would be more flexible ,if i can use TGT stage to get count,as i'm retrieving the job details from datastage repository table with where clause : where name like'TGT%'

Please let me know if there is any other option to get the row count flowing into the TGT stage
Cheers,
Schindler
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

Post by aschindler »

Thanks Prasson,

Can you also tell where can i run these queries and i need to capture the reults in a table.

can i run below query in Universe stage or is there any separate stage to access or query the operation console tables.

Please elaborate.
Cheers,
Schindler
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you on "8.7 onwards" as noted?

Your stage in the DSGetLinkInfo() call should be a transformer in a Server job, an active stage. More than likely you can get both source (incoming) and target (outgoing) counts from it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,
No you can not get these information using Universe stage since it is not stored in universe repository.
Which databse you are using for XMETA repository.I think your Opertation tables will be there in same database. If it is you need to connect to that database.
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

Post by aschindler »

Hi Chulett,

I'm using datatstage 8.7 Version.

Can u briefly explain how to get source and target count using DSGetLinkInfo(),since this function by default returning outgoing link count for a particular stage.

But i need incoming count for a particular stage.
Cheers,
Schindler
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you are on 8.7 then these statistics are already being captured for you. To get "incoming" for a stage, check the "outgoing" from the immediately previous stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

If on DataStage 8.5 or below, this is what I could think of.

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H
Link_Handle = DSAttachJob(JobName,DSJ.ERRNONE)
PenultimateStageName = DSGetLinkInfo(Link_Handle,TargetStageName,LinkName,DSJ.LINKSTAGE)
Ans=DSGetLinkInfo(Link_Handle,PenultimateStageName,LinkName,DSJ.LINKROWCOUNT)
Disclaimer: There might be a more optimal solution than this.
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

This is what i am doing in my project.

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H
JobName = JobNm
StageName = StageNm
LinkName = LnkNm
hJob1 = DSAttachJob(JobName, DSJ.ERRNONE)
RowInputCount = DSGetLinkInfo(hJob1,StageName,LinkName,DSJ.LINKROWCOUNT)
Ans = RowInputCount
Output of the routine is rowcount,its can be Inputrowcount as well output rowcount,just you need to pass appropiate link name ,stage name and job name.
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

Post by aschindler »

Thanks Jerome,

It worked.
Cheers,
Schindler
Post Reply