Page 1 of 1

want to get how many rows written/updated to the o/p file

Posted: Thu Jan 24, 2008 5:19 am
by sarat.srinivas@tcs.com
I want to get Number of Rows written or updated to the o/p to a variable.

How can i get this.

Posted: Thu Jan 24, 2008 6:23 am
by Cr.Cezon
You can use
the function DSGetStageInfo(JobHandle, StageNmae, DSJ.STAGEINROWNUM ) outside the transformer

or the macro DSStageInRowNum inside the trx

regards,
Cristina

Posted: Thu Jan 24, 2008 6:58 am
by AmeyJoshi14
At unix level you can use this: :wink:

. $DSHOME/dsenv
$DSHOME/bin/dsjob -lstages PROJECT_NAME JOB_NAME


you will get the stage names use in the job,you have mentioned in the above command,if you are already aware of output stage name :P then use :

rowcount=`dsjob -stageinfo PROJECT_NAME JOB_NAME STAGE_NAME(outputname) | grep "In Row Number" |cut -d':' -f2|awk '{printf $1}'`

Posted: Thu Jan 24, 2008 7:13 am
by ray.wurlod
A variable in a shell script or a variable in a DataStage BASIC routine, or a variable in some other setting?

Posted: Thu Jan 24, 2008 8:44 am
by sarat.srinivas@tcs.com
A variable in a shell script

Posted: Thu Jan 24, 2008 9:36 am
by Cr.Cezon
Then the solution of AmeyJoshi14 seems a good one.

regards,
Cristina

Posted: Thu Jan 24, 2008 9:47 am
by chulett
Which one you'd use is totally dependant on where you need this information, which the OP has not stated.