Page 1 of 1

Surrogate key with cyclic option

Posted: Mon Jul 22, 2013 4:59 am
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

Posted: Mon Jul 22, 2013 5:37 am
by ArndW
Mod(MySurrogateKey,1000)

Posted: Mon Jul 22, 2013 12:03 pm
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.

Posted: Mon Jul 22, 2013 10:49 pm
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)

Posted: Tue Jul 23, 2013 4:02 am
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.