Increment 1 Digit After Certain Number of Records

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pranabdas
Participant
Posts: 6
Joined: Wed Nov 23, 2005 5:18 am

Increment 1 Digit After Certain Number of Records

Post by pranabdas »

We have to develop one mapping for a field as - "Initialise to 3000. Increase by 1 for every 5000 records."

Please suggest how to develop this. Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Stage variables in a transformer is the first thing that comes to mind. Or the use of the MOD() function. Of course, running this on multiple nodes could complicate the solution, depending on how that needed to be handled.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Integer stage variable svExample initialised to 3000.

Derive stage variable svExample as

Code: Select all

svExample + Not(Mod(@INROWNUM,5000))
Execute Transformer stage in sequential mode.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply