how to generate the 16 digit number in the datastage

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
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

how to generate the 16 digit number in the datastage

Post by pavankatra »

i want to populate the 16 digit incremental number for one column.
column datatype is varchar
how to generate the 16 digit number in the datastage

anyone please help me.
Thanks in advance
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

if its OK to have left padded 0's then use surrogate key stage and convert the output to Number(16) datatype and then map it to varchar as required.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

To expand, generate regular integers, then transform them to strings with a function such as

Code: Select all

Right(Str("0",16):InLink.MyInteger, 16)
For improved performance, initialize a stage variable, say sv16zeroes, to Str("0", 16), and use the stage variable rather than the function call in the derivation expression. That way the Str() function is only evaluated once. You could use "0000000000000000" instead.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

Post by pavankatra »

ray.wurlod wrote:To expand, generate regular integers, then transform them to strings with a function such as

Code: Select all

Right(Str("0",16):InLink.MyInteger, 16)
For improved performa ...
thanks for your reply
let me check.
Post Reply