row count
Moderators: chulett, rschirm, roy
row count
Hi ,
I have to find the row count in my scenario and i am using DSGETLINKINFO and i m giving the stage name, link name and the DSJ.LINKROWCOUNT for row count , but i am getting the ersult with 1 row less. i mean if the row count is 5 , when i use the function , it is giving me 4 i.e. one value less than the actual value.Can any one tell me what might be the issue and how to solve the problem. i can do it through aggregator but i vae to find conuts for 3 links and i have to use again e aggregators as there are three different conditions .
Thanks in advance
I have to find the row count in my scenario and i am using DSGETLINKINFO and i m giving the stage name, link name and the DSJ.LINKROWCOUNT for row count , but i am getting the ersult with 1 row less. i mean if the row count is 5 , when i use the function , it is giving me 4 i.e. one value less than the actual value.Can any one tell me what might be the issue and how to solve the problem. i can do it through aggregator but i vae to find conuts for 3 links and i have to use again e aggregators as there are three different conditions .
Thanks in advance
So you will only get what has gone out so far. I would ask you to add one to the link count but thats unchartered waters as you have constraints so the best way is to use it in an after job subroutine or another job.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Hi ,
I dont have any idea of how to use it after job subroutine.I men how to use that function in after job subroutine and can you please explain me how to use that function in afte job subroutine as do i need to use a routine to use it in after job subroutine. Can anyone please explain me how to use it in after job subroutine
thanks in advance
I dont have any idea of how to use it after job subroutine.I men how to use that function in after job subroutine and can you please explain me how to use that function in afte job subroutine as do i need to use a routine to use it in after job subroutine. Can anyone please explain me how to use it in after job subroutine
thanks in advance
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Write it as an after-job subroutine rather than as a transform function. That is, change the routine type.
This will destroy your source code, so make sure you've preserved that first.
This will destroy your source code, so make sure you've preserved that first.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi Ray ,
Thanks for your help by giving a reply but i was trying to find the row count without using any routines and using the DSLINKGETINFO function in one of the stages in the job. i can able to get the row count but sometimes if i get the row count as 5 it displays as 4 and sometimes it is giving corect row count
And i tried using After job subroutine giving input values as transformer,Insert,
and the code used is
I got the following error 'Error variable unassigned on return from AFTER routine DSU.Count'
Any help is really appreciated.
Thanks for your help by giving a reply but i was trying to find the row count without using any routines and using the DSLINKGETINFO function in one of the stages in the job. i can able to get the row count but sometimes if i get the row count as 5 it displays as 4 and sometimes it is giving corect row count
And i tried using After job subroutine giving input values as transformer,Insert,
and the code used is
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
If count(InputArg,',') <> 2
Then
k = 2
goto ErrorExit
End
Else
StageName = field(InputArg,",",1)
LinkName = field(InputArg,",",2)
x=""
End
JobHandle=DSJ.ME
Insert=DSGetLinkInfo(JobHandle,StageName,LinkName,DSJ.LINKROWCOUNT)
x="Reject Count = " : Insert
ErrorCode = 0
ErrorExit:
ErrorCode = k
I got the following error 'Error variable unassigned on return from AFTER routine DSU.Count'
Any help is really appreciated.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The error message is because the variable called k is not set in every path through the code, and has not been given an initial value. Before/after subroutines only ever have two arguments; this is not something that you need to check.
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.
Hi ray,
i tried to remodify the code
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
$INCLUDE DSINCLUDE JOBCONTROL.H
StageName = field(InputArg,",",1)
LinkName = field(InputArg,",",2)
JobHandle=DSJ.ME
Insert_Count=DSGetLinkInfo(JobHandle,StageName,LinkName,DSJ.LINKROWCOUNT)
x="Reject Count = " : Insert_Count
and when i run the job it ran with no errors but where do i view the output . i mean where is the output i can see for the after job subroutine.
craig - i will definitely give more descritive routine name as of now i am testing it so i used that name.
Any help is really appreciated
thanks in advance
i tried to remodify the code
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
$INCLUDE DSINCLUDE JOBCONTROL.H
StageName = field(InputArg,",",1)
LinkName = field(InputArg,",",2)
JobHandle=DSJ.ME
Insert_Count=DSGetLinkInfo(JobHandle,StageName,LinkName,DSJ.LINKROWCOUNT)
x="Reject Count = " : Insert_Count
and when i run the job it ran with no errors but where do i view the output . i mean where is the output i can see for the after job subroutine.
craig - i will definitely give more descritive routine name as of now i am testing it so i used that name.
Any help is really appreciated
thanks in advance
Hi craig ,
I have to find the row count and insert the row count in the table.And do i need to use the user status at afterjob subroutine. i mean like where do i use the user status and i created a routine and using the userstatus for another condition in the same job. So can i use the same routine for the row count also for the same job, as i am already using the userstatususing DSSetUserStatus routine in the same job?
Thanks in advance
I have to find the row count and insert the row count in the table.And do i need to use the user status at afterjob subroutine. i mean like where do i use the user status and i created a routine and using the userstatus for another condition in the same job. So can i use the same routine for the row count also for the same job, as i am already using the userstatususing DSSetUserStatus routine in the same job?
Thanks in advance