Missing key values when using KeyMgtGetNextValue

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
preetiv
Participant
Posts: 12
Joined: Tue May 26, 2009 12:58 am

Missing key values when using KeyMgtGetNextValue

Post by preetiv »

Hi

I have migrated a server job from Datastage 7.5 version to 8.5 version which uses KeyMgtGetNextValue for generating key sequence values. I noticed that there were some missing key values (there was a jump in sequence) when used in 8.5 which did not happen in 7.5.

Any idea why this can happen?

Thanks,
Preeti
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hard to say. It can depend on the job design... do you always use all values generated or are some assigned and then blocked by a constraint? Or did the job fail and roll back some rows?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Or might another job be generating values for the same sequence name?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
preetiv
Participant
Posts: 12
Joined: Tue May 26, 2009 12:58 am

Post by preetiv »

I have done more testing and found this.

Below is the job design:

Source file --- > Transformer(Has a reference from hash and writes the sequence generated to the hash if the natural key from source value does not exist) and another output link to output file. The sequence generation logic is written in both the output links(first to hash file and then to output file).

The sequence derivation is like this: If isNull(Sequence) then KeyMgtGetNextValue('A',Natural key) else Sequence

It works fine for all the values except when the natural key value is empty. In this case the sequence generated for writing to hash file is different from the one written to output file and there we got a jump.

The same design worked fine on 7.5 version, however, getting this issue in 8.5 version.

As a fix for now, we have calculated the value in stage variable and assigned them on both output links. However, still not sure how it worked in 7.5 and not in 8.5 version
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That would be a question for your official support provider, me thinks.
-craig

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