surrogate ky generator problem

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
prams
Participant
Posts: 73
Joined: Mon Apr 02, 2007 11:26 pm

surrogate ky generator problem

Post by prams »

Hi
in one of my requirement i need to generate sequence number in the target file like

SeqNum| CustName|
0001 | aaaaa
0002 | bbbbbbb
0003 | fdaggghhh

this is my requrement but i am not able get it through surrogate key generator it is giving like 1 2 3 4 like this.

Pls any one can help me


Thanks in Advance

prams
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Are you saying that you are getting "1" but wish to output "0001"? The generator is creating a number which never has leading spaces. There are many ways to create a string like this, one way would be to use the derivation "RIGHT('0000':DecimalToString(In.SequenceColumn),4)"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Note: the generator is creating a number.

You can not apply the transformation within the generator operator. You must add the leading zeroes in a downstream Transformer 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.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

ray.wurlod wrote:Note: the generator is creating a number.

You can not apply the transformation within the generator operator. You must add the leading zeroes in a downstream Transformer stage. ...

You can change the datatype in surrogate key generator from unsigned bigint to Number of length greater than length of bigint

Not satisfied with the answer?

then post discriptive query.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply