Total Record Count

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Total Record Count

Post 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
shivadrash
Participant
Posts: 8
Joined: Mon Jun 13, 2011 2:55 am
Location: india

Re: Total Record Count

Post 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
Regards
Sivanandha
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Total Record Count

Post 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
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Total Record Count

Post 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
shivadrash
Participant
Posts: 8
Joined: Mon Jun 13, 2011 2:55 am
Location: india

Re: Total Record Count

Post 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
Regards
Sivanandha
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Total Record Count

Post 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
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post 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
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Total Record Count

Post 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
Post Reply