row counts

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

row counts

Post 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]
Bala R
Participant
Posts: 66
Joined: Mon May 30, 2005 9:52 pm

Post 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.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Download EtlStats from my tips page.
Mamu Kim
Post Reply