Page 1 of 1

Total Record Count

Posted: Fri Jul 15, 2011 12:56 pm
by pavan_test
Hi All,

I have a datastage job (parallel edition) that counts the numbers of records processed and writes to a text file (or it can write to a peek stage)

After the job completes successfully, I have to send an email to the team with total number of records processed. There is Notification_activity under sequence. how do I read the total number of records processed in a datastage sequence from a parallel job?

Thanks
Mark

Re: Total Record Count

Posted: Fri Jul 15, 2011 1:14 pm
by shivadrash
You can build a simple Transform Routine to see how many records have gone through a particular link. Get this count into the sequence

Total Record Count

Posted: Fri Jul 15, 2011 1:39 pm
by pavan_test
Thank You. I have couple of questions;

There is a environmental parameter @INROWNUM gives me number of records processed however, how can I capture count in a transform routine? and How can pass this count to a sequence?

Thanks
Mark

Total Record Count

Posted: Fri Jul 15, 2011 1:42 pm
by pavan_test
sequence ---Job1 ---Job2

The sequence contains 2 datastage jobs. I have to fnd the total count in the job1 and send an email notification.

Thanks
Mark

Re: Total Record Count

Posted: Fri Jul 15, 2011 1:51 pm
by shivadrash
FUNCTION myGetRowCount(JobName,StageName,LinkName)
$INCLUDE DSINCLUDE JOBCONTROL.H


hJob = DSAttachJob(JobName, DSJ.ERRFATAL)

RowCount = DSGetLinkInfo(hJob, StageName, LinkName, DSJ.LINKROWCOUNT)

ErrCode = DSDetachJob(hJob)

Ans = RowCount

Total Record Count

Posted: Fri Jul 15, 2011 2:11 pm
by pavan_test
Thanks. I was able to find the record count in the job1. How Do I send the total record count in an email to the team from the sequence?

Thanks
Mark

Posted: Fri Jul 15, 2011 2:17 pm
by Mike
Have your parallel job persist the record count on disk, then have your job sequence retrieve it from disk with a command or routine activity and pass it to the email notification activity.

Mike

Total Record Count

Posted: Fri Jul 15, 2011 2:37 pm
by pavan_test
I use this to get the total record count and from a shell script I send an email to the team.

Count=`dsjob -linkinfo $Project $Job $Stage $Link | grep 'Link Row Count' | awk '{print $5}'`

mail -s team.com

Thanks
Mark