Row count of a link

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

shrinivas
Participant
Posts: 53
Joined: Mon Sep 18, 2006 3:42 am
Location: hyd

Post by shrinivas »

I tried hardcoding the values , I even checked for the bad handles, Bad Instances ....... etc....Still getting the rowcount as zero.. Kumar , remeber you suggested me the post yesterday...What was the solution for that topic, I am unable to see that , as i dont have a premium account
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If you are referring to the topic that I have linked, its issue with the Job Monitor not been turned on. Which is not your case.
What was the answer to my questions? Where are you looking for the result? In log? Are you returning the "Ans" the variable where you consolidate the values?
Have you tried to write in to a file?
Else use DsLogInfo() function to log the Ans value so that you can check in Datastage Director.

And you can get the Premium content access with Rs12 per day. Which infact will be more useful that you think in you professional life.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
shrinivas
Participant
Posts: 53
Joined: Mon Sep 18, 2006 3:42 am
Location: hyd

Post by shrinivas »

Ya i am writng the return value in a file , I have used a tranformer where i call the routine in a stage variable and then passing the return value into a sequential file . I checked the same with writing a simple routine , in which I have hard coded ever thing including Job name, stage name and link name, and calling it thru using above mentioned method, still i am getting the value as zero.
My simple routine code is

Code: Select all

#Include DSINCLUDE JOBCONTROL.H

Ans = 0

JB_HANDLE = DSAttachJob("test123",DSJ.ERRWARN)
Lnk_Cnt = DSGetLinkInfo(JB_HANDLE,'DataByGSCOprtr_Read_FF','DataByGSCOprtSrc_Read_lnk',DSJ.LINKROWCOUNT)
JB_HANDLE = DSDetachJob(JB_HANDLE)
Ans = Lnk_Cnt
where "test123" is job name and 'DataByGSCOprtr_Read_FF','DataByGSCOprtSrc_Read_lnk' respective stage name and link name..

I strongly belive , i am missing some settings..
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

And Return(Ans) at the end.
Also add Call DSLogInfo(Ans,"Return value is :" ) and check the log in Director.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
srinath
Participant
Posts: 9
Joined: Wed Nov 09, 2005 7:18 am

Post by srinath »

As per Datastage "StageName is the name of the active stage to be interrogated".. May be you are not giving active stage
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

srinath wrote:As per Datastage "StageName is the name of the active stage to be interrogated".. May be you are not giving active stage
He tested in Manager which gave out some value, so we believe correct value is been passes.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
shrinivas
Participant
Posts: 53
Joined: Mon Sep 18, 2006 3:42 am
Location: hyd

Post by shrinivas »

Ya Srinath , I was giving passive stage name values. after your suggestion when I gave an active stage which is transformer in my case, It's working fine and giving me the appropriate ans . But still I am wondering why it was working when I am trying it thru DS manager.
Thanks Kumar nad Srianth for your valuable help.
Kumar , i will try to get the premium account as soon as I can :D
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? Silly me. Based on your assertation that 'it worked in the Manager' I assumed you knew you were supposed to use an active stage and were actually doing that in your job. Obviously, that's not a fault in the routine itself, but how you were calling it in your job which is what I was suggesting all along. I would also guess that is what you did when you tested it as that would be the only reason that it worked there.

I've got an old rule for supporting others - Assume Nothing. Sorry, I should have done that here, we would have gotten through this a wee bit quicker.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The row count for a link is given by @OUTROWNUM (for output links from a Transformer). You don't need to calculate anything while the job is running.

As noted, you can interrogate the job subsequently.

You could also generate 1 as a single column on an output link and pass this through an Aggregator stage that sums, or generate @OUTROWNUM and pass this through an Aggregator stage that returns the Last value.

Just some extra ideas.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

I've got an old rule for supporting others - Assume Nothing. Sorry, I should have done that here, we would have gotten through this a wee bit quicker.
Iam perfectly in this category :oops:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply