XML - Zero output count
Posted: Mon Oct 13, 2008 9:38 am
I have a requirement. I am using an XML input stage and using xslt to get some specific data from the xml and push to a flat file. Incase my xml don't have any tag which i want then the xml output link will give '0' recods and the remaining part of the job will pass through.
To handle this situvation what i did is, I wrote a after job subroutine in the transformer to check the number of records coming from the xml and if it is zero, the job will abort.
My routine will look like this
$INCLUDE DSINCLUDE JOBCONTROL.H
Result = DSGetLinkInfo (DSJ.ME, 'XML_Input_10', 'ABC', DSJ.LINKROWCOUNT)
ErrorCode=0
if Result =0 then
Call DSLogInfo('Job Failed as no valid record in source' : Result , "MyTransform")
ErrorCode = 1
end
.
Someone told me that, this method will impact the perfomance of the job. To work my idea the perfomance statistics should be always on or something liek that.
What is the truth here? Can I use this idea to abort a job incase my XML out put me zero records? Is there a better idea?
To handle this situvation what i did is, I wrote a after job subroutine in the transformer to check the number of records coming from the xml and if it is zero, the job will abort.
My routine will look like this
$INCLUDE DSINCLUDE JOBCONTROL.H
Result = DSGetLinkInfo (DSJ.ME, 'XML_Input_10', 'ABC', DSJ.LINKROWCOUNT)
ErrorCode=0
if Result =0 then
Call DSLogInfo('Job Failed as no valid record in source' : Result , "MyTransform")
ErrorCode = 1
end
.
Someone told me that, this method will impact the perfomance of the job. To work my idea the perfomance statistics should be always on or something liek that.
What is the truth here? Can I use this idea to abort a job incase my XML out put me zero records? Is there a better idea?