Page 1 of 1

KeyMgtGetNextValueConcurrent

Posted: Thu May 11, 2006 8:52 am
by somu_june
Hi,


Iam using a KeyMgtGetNextValueConcurrent function in my job . When I am using in development environment it is generating numbers like this CBL1 to CBL100 and If I ran second time it is generating from CBL101 to CBL200 but when I am using for testing it is generating from CBL1 to CBL100. But I want from CBL201 to CBL300.


My doubt here is when I change server from development to testing is this function generate number from starting example from 1.



Thanks,
Somaraju.

Posted: Thu May 11, 2006 9:00 am
by ArndW
The routine stores it's history information into a local file, so your generated numbers in any different project will be different; i.e. they will continue from where they left off last time.

Re: KeyMgtGetNextValueConcurrent

Posted: Thu May 11, 2006 9:10 am
by raoraghunandan
somu_june wrote:Hi,


Iam using a KeyMgtGetNextValueConcurrent function in my job . When I am using in development environment it is generating numbers like this CBL1 to CBL100 and If I ran second time it is generating from CBL101 to CBL200 but when I am using for testing it is generating from CBL1 to CBL100. But I want from CBL201 to CBL300.


My doubt here is when I change server from development to testing is this function generate number from starting example from 1.


Thanks,
Somaraju.

Hi,

As the name suggests "KeyMgtGetNextValueConcurrent" , this function will generate the sequential numbers based on the other jobs and also on history. If you want to a specific key values, I do not think you should use these functions at all.

Posted: Thu May 11, 2006 9:39 am
by somu_june
Hi,


Can any one tell me what function can I use to achieve my target.






Thanks,
Somaraju.

Posted: Thu May 11, 2006 10:20 am
by ArndW
If you want to share a sequence for use in multiple projects, you will need to copy the function and replace the OPEN statement as well as the file creation one with OPENSEQ and shell call to mkdbfile so that the KeyMgtGetNextValueConcurrent uses the same physical file no matter which project is calling it. If your environments are on different machines or use different instances then you cannot use this method, as record level locking across nodes is no longer supported in DataStage (it rermains functional in UniVerse but has been removed in the DS flavor).

Posted: Thu May 11, 2006 10:38 am
by somu_june
Hi Arnd,

My problem here is already there are numbers generated by the job I mean by keymgtnextvalueconcurrent like CBL1 to CBL100 in my DB2 table. MY aim is to take the maximum number that is CBL100 and I want to generate CBL101 to CBL200 for my next run of the same job even though they are of different projects. How to achieve this , if you have any idea please let me know.



Thanks,
SomaRaju.

Posted: Thu May 11, 2006 10:41 am
by DSguru2B
Dont use that function then.
Design your job in sucha way that it gets the max from the table which in your case will be CBL100.
Strip out the numbers which will be 100 and do max+1 and concatenate it to CBL. Use that as your key for the target db.

Posted: Thu May 11, 2006 12:06 pm
by DSguru2B
Or if you dont want to use the sequence from the last left over you can always delete the sequence in the before job execTCL.

Posted: Thu May 11, 2006 2:40 pm
by gateleys
If you are looking at force-update, then use the Admin client to enter the command-

UPDATE SDKSequences USING DICT VOC SET F1 = '201' WHERE @ID = 'YourSequenceName';

Then prepend "CBL" to it in the Xfmr.

gateleys