Page 2 of 2

Posted: Thu Mar 08, 2007 5:11 am
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

Posted: Thu Mar 08, 2007 5:20 am
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.

Posted: Thu Mar 08, 2007 5:30 am
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..

Posted: Thu Mar 08, 2007 5:34 am
by kumar_s
And Return(Ans) at the end.
Also add Call DSLogInfo(Ans,"Return value is :" ) and check the log in Director.

Posted: Thu Mar 08, 2007 6:13 am
by srinath
As per Datastage "StageName is the name of the active stage to be interrogated".. May be you are not giving active stage

Posted: Thu Mar 08, 2007 6:15 am
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.

Posted: Thu Mar 08, 2007 7:21 am
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

Posted: Thu Mar 08, 2007 8:06 am
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.

Posted: Thu Mar 08, 2007 8:08 am
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.

Posted: Thu Mar 08, 2007 4:50 pm
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: