Routine for getting the count in the link
Posted: Tue Jan 18, 2011 12:04 am
Can anybody share a subroutine which returns the count from the source stage link and to a target stage link and to a reject stage link. It is very urgent.
A short text to describe your forum
http://dsxchange.com./
Code: Select all
DEFFUN svtGetLinkCount(JobName, StageName ,LinkName) CALLING "DSU.COUNT.FILES"
*************************************************************************************************************************
* Header files to be included
*************************************************************************************************************************
#include DSINCLUDE JOBCONTROL.H
Ans = 0
*************************************************************************************************************************
* Create local variable for arguements
*************************************************************************************************************************
ThisJob = JobName
ThisStage = StageName
ThisLink = LinkName
*************************************************************************************************************************
* Get the handle of the job
*************************************************************************************************************************
JobHandle = DSAttachJob(ThisJob, DSJ.ERRFATAL)
*************************************************************************************************************************
* Get row count for the link
*************************************************************************************************************************
Result = DSGetLinkInfo (JobHandle, ThisStage, ThisLink, DSJ.LINKROWCOUNT)
*************************************************************************************************************************
* Release the handle
*************************************************************************************************************************
Nothing = DSDetachJob(JobHandle)
*************************************************************************************************************************
* Return the row count
*************************************************************************************************************************
Ans = Result
Return(Ans)