Page 1 of 1
KeyMgtGetNextValueConcurrent routine
Posted: Mon Dec 12, 2011 12:20 pm
by ketfos
Hi,
Under repository, - Routines - SDK, there are routines KeyMgtGetNextValueConcurrent
KeyMgtGetMaxKey
KeyMgtGetMaxKeyFromODBCToUSER
KeyMgtGetNextValue
When I go to Transformer, Select DSROUTINES - Routines - SDK, I se only one routine
KeyMgtGetMaxKeyFromODBCToUSER
Can you tell me how to view other SDK key routines in Transformer?
Thanks
ketfos
Posted: Mon Dec 12, 2011 12:26 pm
by pandeesh
i guess you need to customize that!
Posted: Mon Dec 12, 2011 1:44 pm
by ray.wurlod
You could try making sure that they're compiled. Are they perhaps to be found under DS Functions rather than Functions in the operand menu?
Posted: Mon Dec 12, 2011 5:08 pm
by chulett
Those have transforms associated with them, from what I remember. Once those are in place they no longer appear in the list of routines.
Posted: Tue Dec 13, 2011 6:33 pm
by ketfos
Thanks.
yes it has transform associated with it.
That is why it is not displayed...
The description of this routine is ---
"Routine to generate a sequential number.
The routine argument is the name associated with the sequence.
The routine uses a file to store the next available number. It reads the number from the file on each invocation; a lock on the file prevents concurrent access."
Where is the file stored? Is it internal to datastage?
Ketfos
Posted: Tue Dec 13, 2011 7:18 pm
by ray.wurlod
Source for the routine should be in your Repository under the Routines branch.
Posted: Tue Dec 13, 2011 10:29 pm
by chulett
In there you'll see it uses an account-based hashed file (type 2 from what I recall) to store the values you've passed in and the current surrogate for each value.
SDKSequences hash file
Posted: Wed Dec 14, 2011 1:14 am
by ketfos
KeyMgtGetNextValueConcurrent - I used this in the transformer KeyMgtGetNextValueConcurrent(1) in one job and KeyMgtGetNextValueConcurrent(2) in another job.
I ran the first job for 100 rows and second job for 10 rows.
It generated the key values starting from 1..100 and 1..10 in each case.
I see a hash file SDKSequences in the project folder.
When I query the hash file using select * from SDKSequences, it returns two records with value 1 and 2.
How do I set the counter to start value of 1 for each of the job.
i.e i want surrogate key generation to start from 1.
Thanks
Ketfos
Posted: Wed Dec 14, 2011 2:37 am
by ray.wurlod
Did you
Search DSXchange for an answer?
This post has three different techniques.