Page 1 of 1

row counts

Posted: Thu Dec 01, 2005 1:22 pm
by sainath
hi

When i searched about row counts in this forum i got following codes.

1.

$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF

StageName = field (InputArg," ",1)
LinkName = field (InputArg," ",2)
RowCount = DSGetLinkInfo(DSJ.ME, StageName, LinkName, DSJ.LINKROWCOUNT)


2.
$INCLUDE DSINCLUDE JOBCONTROL.H

rJobHandle = DSAttachJob(JobName, DSJ.ERRNONE)

If NOT(rJobHandle) Then
Ans = -99
End Else
Ans = DSGetLinkInfo(rJobHandle, StageName, LinkName, DSJ.LINKROWCOUNT)
End

DetachResult = DSDetachJob(rJobHandle)





1.Can i attach this code to the job sequence and get counts daily

2.how can i store the counts in seperate table

3.get email message if there is in drop in counts.

pl advise
[/code]

Posted: Thu Dec 01, 2005 2:26 pm
by Bala R
Sainath,
The DSGetLinkInfo function returns the number of rows that passed down a link if you specify the infotype DSJ.LINKROWCOUNT. When the link is not in the same job then you write a routine to first invoke DSAttachJob to get the rowcounts as you have already found. When you have the rowcount returned from your routine the decision is yours to store it in a hashfile or table and compare with the previous values to send the mail. You could write all those in a after job routine and invoke it from the job you want to check for rowcounts. Look at the DSSendMail function on how to send an email.
HTH.

Posted: Thu Dec 01, 2005 5:27 pm
by kduke
Download EtlStats from my tips page.