KeyMgtGetNextVal for the same table in two separate jobs.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
frisha
Participant
Posts: 12
Joined: Wed Nov 05, 2003 1:31 pm

KeyMgtGetNextVal for the same table in two separate jobs.

Post by frisha »

Hi, All!

I loaded information into the table(created rows). For unique sequence I used KeyMgtGetNextVal function. In a future, I would have to add some new rows from different file(output) as an input to the table.
In this case, how would I use KeyMgtGetNextVal to continue sequence number where it was left.
It should metter for relationship with other tables as FK.

Maybe somehow I can update previous ran job? Is it possible?


Thanks.
raju_chvr
Premium Member
Premium Member
Posts: 165
Joined: Sat Sep 27, 2003 9:19 am
Location: USA

Re: KeyMgtGetNextVal for the same table in two separate job

Post by raju_chvr »

If you use the same key in the second job also then u shld get continued values. The second job key starts from the point where the First job key has ended.

Is this you what are looking for ?
frisha
Participant
Posts: 12
Joined: Wed Nov 05, 2003 1:31 pm

Post by frisha »

Unfortunetely,
my sequence increments each time differently. It is not right sequence and I can not find a pattern. I mean, it is not incremented by same number.
raju_chvr
Premium Member
Premium Member
Posts: 165
Joined: Sat Sep 27, 2003 9:19 am
Location: USA

Post by raju_chvr »

Can you post the function you are using here ?

It is well tested functionality of DataStage and not new to 6X so, I don't think there is any bug related to it.
frisha
Participant
Posts: 12
Joined: Wed Nov 05, 2003 1:31 pm

Post by frisha »

Raju,

After more research, I found that I used this key function as a variable.
And I should not do this for the second job to insert into existing table.
I changed the logic and put it as derivation for primary key and this function does the job (continue incrementing sequence when it was left from previous job).
Thank you for respond and help.
Post Reply