Link Count
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Link Count
FUNCTION myGetRowCount(JobName,StageName,LinkName)
$INCLUDE DSINCLUDE JOBCONTROL.H
hJob = DSAttachJob(JobName, DSJ.ERRFATAL)
RowCount = DSGetLinkInfo(hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
ErrCode = DSDetachJob(hJob)
Ans = RowCount
I was looking for a working piece of routine for link row count and got the above code. I am using it in the Transformer in a very simple job to test out the code ,but the job is not getting completed , its running on and on and ultimately I had to abort the job. I am not able to figure out the solution.
Thanx in advance.
$INCLUDE DSINCLUDE JOBCONTROL.H
hJob = DSAttachJob(JobName, DSJ.ERRFATAL)
RowCount = DSGetLinkInfo(hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
ErrCode = DSDetachJob(hJob)
Ans = RowCount
I was looking for a working piece of routine for link row count and got the above code. I am using it in the Transformer in a very simple job to test out the code ,but the job is not getting completed , its running on and on and ultimately I had to abort the job. I am not able to figure out the solution.
Thanx in advance.
Use it after the job finishes in a routine activity in a sequence job.
OR convert the routine from a transform to before/after job subroutine and call it in the after job subroutine.
You can also search the forum for other ways of getting row counts.
OR convert the routine from a transform to before/after job subroutine and call it in the after job subroutine.
You can also search the forum for other ways of getting row counts.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Yes the job attached is the same job in which , I am trying to find out the row count , I am bit confused as always the routine will contain the name of the job in which the routine has been called, stage names and link names shoud differ for row counts of different link.kumar_s wrote:As asked, pls clarify if you are trying to attached the same job in the Transformer where it resides and trying to find row count?
Please try to keep discussions of your problems in one place. Why start this post and tag the same issue onto the end of this post? ![Evil or Very Mad :evil:](./images/smilies/icon_evil.gif)
No-one enjoys trying to carry on multiple conversations on the same subject at the same time.
![Evil or Very Mad :evil:](./images/smilies/icon_evil.gif)
No-one enjoys trying to carry on multiple conversations on the same subject at the same time.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Basically there is a requirement of getting the number of rows coming out of aggregator stage , which precedes the transformer stage , and hence the routine is being called in the transformer. But the job is not getting finished.chulett wrote:The problem persists because... you haven't changed anything? Or is this now a separate job that checks another job or jobs? Describe it, this problem job - in detail - especially why it needs to call this routine in the transformer.
What do you plan on doing with this 'number of rows coming out of the aggregator stage'? What comes after this transformer? And define 'is not getting finished'... how far does it get? Where does it seem to get stuck?
I get the impression you still don't understand the implications of what you are doing. For every record that comes out of the agg, you call this routine. Over and over. And over. I sincerely doubt that's what you really need.
Tell us your actual requirement, not your implementation. What are you trying to accomplish here?![Confused :?](./images/smilies/icon_confused.gif)
I get the impression you still don't understand the implications of what you are doing. For every record that comes out of the agg, you call this routine. Over and over. And over. I sincerely doubt that's what you really need.
Tell us your actual requirement, not your implementation. What are you trying to accomplish here?
![Confused :?](./images/smilies/icon_confused.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
The total number of rows coming out from the output link of the aggregator stage or sorter stage is required , that values need to be populated in the file. On invoking the routine in the transformer and passing the jobname , linkname and the stage name as arguments in the job the job is running fine but it is not reaching completion. The status in the director remains " running"chulett wrote:What do you plan on doing with this 'number of rows coming out of the aggregator stage'? What comes after this transformer? And define 'is not getting finished'... how far does it get? Where does it seem to get stuck?
I get the impression you still don't understand the implications of what you are doing. For every record that comes out of the agg, you call this routine. Over and over. And over. I sincerely doubt that's what you really need.
Tell us your actual requirement, not your implementation. What are you trying to accomplish here?
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact: