count the records in stage

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
Poonam Singh
Participant
Posts: 5
Joined: Wed Aug 16, 2006 10:58 am

count the records in stage

Post by Poonam Singh »

Hi all,



In my one of job I have 3 stages

ODBC stage, transformer stage then sequential_file stage
DSLink3 joins ODBC stage to transformer stage and
DSLink4 joins transformer to sequential_file stage.

Is that possible I can use 4th stage to count records which is going
into seqential_file stage from transformer stage.

I know I can do it in job control with DSGetLinkInfo function.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In a server job you can add a fourth stage, to dispose of the count (for example a Sequential File stage). You can form the count in an Aggregator stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Add two more columns in your aggregator with derivation @INROWNUM for the count and a dummy key for the other.Feed it to the aggregator, grouped on the dummy key and Last for the count column.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or just one column with any non-null value from your feed and Count it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

chulett wrote:Or just one column with any non-null value from your feed and Count it.
Actually this is a better way.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply