KeyMgtGetNextValueConcurrent

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
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

KeyMgtGetNextValueConcurrent

Post 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.
somaraju
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
raoraghunandan
Charter Member
Charter Member
Posts: 19
Joined: Sun Jul 20, 2003 4:29 am

Re: KeyMgtGetNextValueConcurrent

Post 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.
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi,


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






Thanks,
Somaraju.
somaraju
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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).
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post 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.
somaraju
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post 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
Post Reply