Getting count of records passed through a link
Moderators: chulett, rschirm, roy
Getting count of records passed through a link
I am a new user of DSEE.Please advise me how should I get the count of records processed by a link. I dont find any built-in routine for that.
If you want the information from inside the job, the transform stage variables @INROWNUM and @OUTROWNUM will work per instance. If you want the information from outside of the job, you can use a routine such as DSGetLinkInfo() or use the UNIX command line "dsjob -report" to get that data.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Re: Getting count of records passed through a link
you can use aggregator stage for same , there is utility called aggaregation type "Count Rows".
aaikat wrote:I am a new user of DSEE.Please advise me how should I get the count of records processed by a link. I dont find any built-in routine for that.
I faced error while compiling a server routine code with the function DSGetLinkInfo. ( I tried for server routine as I didn't find place to write code in case of Parallel routine).I wrote the following code :
hJob = DSAttachJob(JobName, DSJ.ERRFATAL)
If NOT(hJob) Then
Call DSLogFatal("Job Attach Failed", "JobControl")
Abort
End
Ans = DSGetLinkInfo (hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
I get the following error :-
Compiling: Source = 'DSU_BP/DSU.MyGetLinkCount', Object = 'DSU_BP.O/DSU.MyGetLinkCount'
?
0009 Ans = DSGetLinkInfo (hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
^
',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
Array 'DSAttachJob' never dimensioned.
WARNING: Variable 'DSJ.ERRFATAL' never assigned a value.
Array 'DSGetLinkInfo' never dimensioned.
3 Errors detected, No Object Code Produced.
hJob = DSAttachJob(JobName, DSJ.ERRFATAL)
If NOT(hJob) Then
Call DSLogFatal("Job Attach Failed", "JobControl")
Abort
End
Ans = DSGetLinkInfo (hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
I get the following error :-
Compiling: Source = 'DSU_BP/DSU.MyGetLinkCount', Object = 'DSU_BP.O/DSU.MyGetLinkCount'
?
0009 Ans = DSGetLinkInfo (hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
^
',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
Array 'DSAttachJob' never dimensioned.
WARNING: Variable 'DSJ.ERRFATAL' never assigned a value.
Array 'DSGetLinkInfo' never dimensioned.
3 Errors detected, No Object Code Produced.
1. You must include the line "$INCLUDE DSINCLUDE JOBCONTROL.H"
2. You will need to fill the values for StageName and LinkName to get values returned to you. {amended, added $INCLUDE to text}
2. You will need to fill the values for StageName and LinkName to get values returned to you. {amended, added $INCLUDE to text}
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Try this one and see if it works.
Don't forget to pass teh stagename and linkname as Arguments to the routine. Or, just hardcode them and test them.
IHTH
Kris.
Code: Select all
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
hJob = DSAttachJob(JobName, DSJ.ERRFATAL)
If NOT(hJob) Then
Call DSLogFatal("Job Attach Failed", "JobControl")
Abort
End
Else
Ans = DSGetLinkInfo (hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
End
DetachResult = DSDetachJob(hJob)
IHTH
Kris.
The $IFNDEF JOBCONTROL.H & $ENDIF are not needed since they are already in the included header filekris007 wrote:Try this one and see if it works.Don't forget to pass teh stagename and linkname as Arguments to the routine. Or, just hardcode them and test them.Code: Select all
$IFNDEF JOBCONTROL.H $INCLUDE DSINCLUDE JOBCONTROL.H $ENDIF hJob = DSAttachJob(JobName, DSJ.ERRFATAL) If NOT(hJob) Then Call DSLogFatal("Job Attach Failed", "JobControl") Abort End Else Ans = DSGetLinkInfo (hJob, StageName, LinkName, DSJ.LINKROWCOUNT) End DetachResult = DSDetachJob(hJob)
IHTH
Kris.
I Don't like aborting routines there is no need to abort anything
Adding checks to see if the routines you use were successfull is advisable
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
I agree with you. I just made changes to the routine posted by OP from the top of my head.
In fact, I practice writing routines the way you have described. Not aborting and adding checks.
Here's the routine with more changes.
In fact, I practice writing routines the way you have described. Not aborting and adding checks.
Here's the routine with more changes.
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
hJob = DSAttachJob(JobName, DSJ.ERRNONE)
If NOT(hJob) Then
Ans=-99
End
Else
Ans = DSGetLinkInfo (hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
End
DetachResult = DSDetachJob(hJob)[code]
Even though I don't do it, the ABORT can be kept in the routine, as the DSLogFatal should never return. But when testing the routine from the manager the execution is not part of a job and thus the DSLogFatal() call will return and then the ABORT will kick in.
But the original poster (OP) still needs to fill in values for StageName and LinkName in order to get a value back.
But the original poster (OP) still needs to fill in values for StageName and LinkName in order to get a value back.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
No, but you can use it in a Routine activity in the job sequence that runs the parallel job.
You can also look in the job log - every "active stage finishing" message carries row counts for links connected to that stage.
You can also look in the job log - every "active stage finishing" message carries row counts for links connected to that stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.