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

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
sarat.srinivas@tcs.com
Participant
Posts: 26
Joined: Fri Jul 13, 2007 6:33 am

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

Post 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.
V.Sarat Srinivas
Cr.Cezon
Participant
Posts: 101
Joined: Mon Mar 05, 2007 4:59 am
Location: Madrid

Post 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
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post 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}'`
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A variable in a shell script or a variable in a DataStage BASIC routine, or a variable in some other setting?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sarat.srinivas@tcs.com
Participant
Posts: 26
Joined: Fri Jul 13, 2007 6:33 am

Post by sarat.srinivas@tcs.com »

A variable in a shell script
V.Sarat Srinivas
Cr.Cezon
Participant
Posts: 101
Joined: Mon Mar 05, 2007 4:59 am
Location: Madrid

Post by Cr.Cezon »

Then the solution of AmeyJoshi14 seems a good one.

regards,
Cristina
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Which one you'd use is totally dependant on where you need this information, which the OP has not stated.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply