Difference in key management functions

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
tostay2003
Participant
Posts: 97
Joined: Tue Feb 21, 2006 6:45 am

Difference in key management functions

Post by tostay2003 »

Hi all,

Got few doubts

What are the differences between
a) KeyMgtGetNextValue -> Generates Sequential numbers
b) KeyMgtGetNextValueConcurrent-> whats the meaning of concurrent environment.
c)KeyMgtGetMaxKey-> help in datastage informs to use ODBC stage for this, can we use other stages as well? and what does this do?


other questions :

1) How to generate sequential numbers starting from certain values using all the above 3 functions.
2) The sequential numbers start from last value, even if i truncate the table in database and restart the datastage? Shouldnt it start from 1 as earlier. If i need it that way what should i do.

Thanks a lot for your cooperation.

Regards
tostay2003
Participant
Posts: 97
Joined: Tue Feb 21, 2006 6:45 am

Post by tostay2003 »

Hi no one is answering :(
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Concurrent means simultaneous jobs are calling the function for the same table.

Surrogate key assignment outside a database requires a "seed" value, in other words the maximum value in the target table. You need to set the seed value prior to calling the function to make sure your database value matches what's in the storage point of the seed.

I recommend you spend some time searching the forum and learning about surrogate key assignment.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Correct, nobody is answering (so far).

Part of the reason that I am not interested in doing is that you mixed questions and statements and said you have "doubts". Another part is that the source code is available for you to do your own research. For example - could the difference between "KeyMgtGetNextValue" and "KeyMgtGetNextValueConcurrent" have something to do with one dealing with concurrent (i.e. parallel) runs? Just a glance at the manager and code will show that the comments actually explain this.

Your other questions show that instead of looking at the code or documentation or writing a test job or two with these routines you have decided to post all-encompassing questions here. So instead of getting help here for this issue you've decided to get the answers presented on a plate. I am sure that someone else will be able to assist you in this. Maybe. Or you could post a specific question on some aspect of key management that you would like assistance on and see that you will get a more immediate and certainly a more cordial response.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I didn't answer because I was asleep (different time zone from yours). The others' answers have covered any ground I would have covered. That's the way of things at an all volunteer site.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Post by vsi »

ArndW wrote:Correct, nobody is answering (so far).

Part of the reason that I am not interested in doing is that you mixed questions and statements and said you have "doubts". Another part is that the source code is available for you to do your own research. For example - could the difference between "KeyMgtGetNextValue" and "KeyMgtGetNextValueConcurrent" have something to do with one dealing with concurrent (i.e. parallel) runs? Just a glance at the manager and code will show that the comments actually explain this.

Your other questions show that instead of looking at the code or documentation or writing a test job or two with these routines you have decided to post all-encompassing questions here. So instead of getting help here for this issue you've decided to get the answers presented on a plate. I am sure that someone else will be able to assist you in this. Maybe. Or you could post a specific question on some aspect of key management that you would like assistance on and see that you will get a more immediate and certainly a more cordial response.
The thing is i am a) completely new to datastage, cant read code properly (b) dont have any Enterprise Edition with me (c) Not working in any company so far. Only documents i have got with me is server guide and parallel guide, with internet connection and offcourse a little access (whenever system is free) to server edition.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

OK, but keep your posts less complex to answer. Your original post needs a lot of time to answer, you posted about 8 different questions at the same time - we are volunteers here.

The difference between the normal KeyMgtGetNextValue and KeyMgtGetNextValueConcurrent is that the first routine is meant to be used by one process in one job. If two processes were to concurrently use this routine it might result in duplications. The concurrent one takes care of that, but it is less efficient than the former.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Difference in key management functions

Post by gateleys »

tostay2003 wrote:1) How to generate sequential numbers starting from certain values using all the above 3 functions.
2) The sequential numbers start from last value, even if i truncate the table in database and restart the datastage? Shouldnt it start from 1 as earlier. If i need it that way what should i do.
Regards
The sequential numbers generated by DataStage are stored in a hashed file called SDKSequences in your project folder. To answer your second question- This SDKSequences is NOT in sync with the external database(s). Hence, you truncating the table will have no impact on the DS sequence. However, regarding the first question, you can update the SDKSequences against your sequence from commandline to set it to the value that you want. Alternatively, you can create a job with a hashed file that reads the sequences, and manipulate the NextValue to suit your need.

gateleys
Post Reply