Surrogate Key Generation

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
dsdoubt
Participant
Posts: 106
Joined: Sat Jul 15, 2006 12:17 am

Surrogate Key Generation

Post by dsdoubt »

Hi,

This is very basic question. I know, this must have been discussed already. I tried searching the forum, but couldnt find the right link.

I need to generate Surrogate key using Surrogate key Gen stage.

This is what I did.

I created a job with a Row Gen and Surroage Key stage and created a Surrogate key file.

Used the same file path in the actual job where the value has to be used in Transformer. Used the NextSurrogateKey() to increment the value.

Its working so far. But Iam not sure, what to pass the Initial Value as. So for every run, the jobs starts the value from '1' which I had given. I need to make it increment from the last value of the previous run. May I now the right option on what do I pass the first time and what do I pass each time?

Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are three job designs using the SKG stage.

A job with no input or output link will create the state file.

A job with an input link only can be used to initialize the state file.

A job with an output link only can be used to deliver surrogate key values.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply