Surrogate key with cyclic option

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
RPhani
Participant
Posts: 32
Joined: Sun Aug 26, 2012 7:03 am
Location: Hyd

Surrogate key with cyclic option

Post by RPhani »

Hi Experts,

I am generating sequence numbers by Transformer's Surrogate Key Option.Initial value is 1.

My requirement is:
Once the Surrogate key value reached to 1000,Then it has to start from Initial value.

Thanks in advance,
Phani
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Mod(MySurrogateKey,1000)
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,
There will gap in your sequence number if input records to your transformer stage is not evenly distributed to all nodes,that you have to make sure otherwise you need to run transformer in sequential mode.
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

I assume RPhani is generating sequence using surrogate key (state file) but not generating numbers by formula or loop.

Use a stagevariable and map the generated value in the function as Arnd suggested:
Mod( svSurrKey,1000)
N.Srinivas
India.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,

RPhani has mentioned that he is using "Transformer's Surrogate Key" i.e. as per my understanding he want to generate sequence in Transformer stage using surrogate key feature added in version 8x.
Post Reply