Routine DSJ LINKROWCOUNT Error
Moderators: chulett, rschirm, roy
Routine DSJ LINKROWCOUNT Error
Hi,
I have a before after job subroutine to capture records in a link , but I'm always getting result as -1 .
Below is my routine
$ INCLUDE DSINCLUDE JOBCONTROL.H
RoutineName = "TestRout"
StageName = Field (InputArg,",",1)
LinkName = Field (InputArg, ",",2)
vRowcount = 0
Errorcode = 0
mainJob = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
JobName = mainJob
IF JobName = DSJE.BADHANDLE
THEN
Call DSLogWarn("cannot attach the job", " ")
Errorcode = 0
End
vRowcount = DSGetLinkInfo (JobName,StageName,LinkName,DSJ.LINKROWCOUNT)
Call DSLogWarn("Link Rowcount":" ":vRowcount, " " )
Errorcode = 0;
From above code I'm capturing the rowcount value in a log and I'm seeing -1 always, even the link processed 5 rows in a job, I also checked I'm getting proper JobName, stagename, LinkName before calling DSGetLinkInfo and they are passed correctly and I'm calling this routine as after job subroutine with parameter value Cpy_Output,To_Cpy_outlook. I'm trying to capture record count for active stage transformer.
Any help is greatly appreciated
Thanks
I have a before after job subroutine to capture records in a link , but I'm always getting result as -1 .
Below is my routine
$ INCLUDE DSINCLUDE JOBCONTROL.H
RoutineName = "TestRout"
StageName = Field (InputArg,",",1)
LinkName = Field (InputArg, ",",2)
vRowcount = 0
Errorcode = 0
mainJob = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
JobName = mainJob
IF JobName = DSJE.BADHANDLE
THEN
Call DSLogWarn("cannot attach the job", " ")
Errorcode = 0
End
vRowcount = DSGetLinkInfo (JobName,StageName,LinkName,DSJ.LINKROWCOUNT)
Call DSLogWarn("Link Rowcount":" ":vRowcount, " " )
Errorcode = 0;
From above code I'm capturing the rowcount value in a log and I'm seeing -1 always, even the link processed 5 rows in a job, I also checked I'm getting proper JobName, stagename, LinkName before calling DSGetLinkInfo and they are passed correctly and I'm calling this routine as after job subroutine with parameter value Cpy_Output,To_Cpy_outlook. I'm trying to capture record count for active stage transformer.
Any help is greatly appreciated
Thanks
somaraju
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I'm getting current job name and I need to get the proper output from DSGetLinkInfo function, even if the job handling section is wrong since the if clause will not be executed and goes directly to DSGetLinkInfo function, but it is always throwing -1 output .
I don't think it is happening due to bad jobhandle, since I can see job name . If I'm wrong correct me
Thanks
I don't think it is happening due to bad jobhandle, since I can see job name . If I'm wrong correct me
Thanks
somaraju
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Since you are using DSJ.ME as the job handle, a lot of the code is superfluous. I can't check right now, but I seem to recall that the link row count information isn't available until after the job has finished, but I'm not 100% certain - it would explain your routine's behaviour.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Re: Routine DSJ LINKROWCOUNT Error
Thanks Craig - I looked at the code again:
should read:somu_june wrote:...
vRowcount = DSGetLinkInfo (JobName,StageName,LinkName,DSJ.LINKROWCOUNT)
...
Code: Select all
vRowcount = DSGetLinkInfo(DSJ.ME,StageName,LinkName,DSJ.LINKROWCOUNT)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Re: Routine DSJ LINKROWCOUNT Error
I would say that is all that is needed, the "attach" process is superfluous and ErrorCode only needs one assignment and job done...