How to use KeyMgtGetNextValue routine

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
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

How to use KeyMgtGetNextValue routine

Post by nkln@you »

How to use the routine KeyMgtGetNextValue, for getting the surrogate key from a Hash file created by the user.


i.e if i want to get the number of rows in a hash file, can i use this routine.


And also how this routine works.
Thanks in advance for your suggestion.
Aim high
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

with the KeyMgtGetNextValue you can generate Numbers, each time you call this function you get a number one number higher. Every key has to have a name. If you call your number Jack, each time calling Jack with this routine you get one more. There are functions to set Jack back to zero, You can have as much counters as you want, each has to have an other name.

For to get the numbers of rows in a hash-file there are other functions. You can set up for example a "select count(*) from HashfileName" for to get the number.
peternolan9
Participant
Posts: 214
Joined: Mon Feb 23, 2004 2:10 am
Location: Dublin, Ireland
Contact:

Re: How to use KeyMgtGetNextValue routine

Post by peternolan9 »

Hi nkln@you,
please be aware that the performance of this routine is terrible and should be avoided if your volumes are above nominal.

I think someone else posted a routine.....we had one developed and I believe the client owns it so I wouldn't post it here.
nkln@you wrote:How to use the routine KeyMgtGetNextValue, for getting the surrogate key from a Hash file created by the user.


i.e if i want to get the number of rows in a hash file, can i use this routine.


And also how this routine works.
Thanks in advance for your suggestion.
Best Regards
Peter Nolan
www.peternolan.com
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

I need to start the key generation at a particular number, in this case is changing (Copy) the routine the best way to do this, I did read it before but I am not sure where !
Thanks,
pavanns
Participant
Posts: 27
Joined: Wed Sep 28, 2005 8:00 pm
Location: ca

Post by pavanns »

you can generate a new set of keys for all teh attributes of the colum specified and they keep changing each time you run ...key managment features basically done in the transformer stage and can be set to any value...and a routine can be designed for a generation of a user defined key
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

there is alreadya routine present !
pavanns
Participant
Posts: 27
Joined: Wed Sep 28, 2005 8:00 pm
Location: ca

Post by pavanns »

ru looking for teh location of the routine ?
pavan
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

dude,
I know where it is, I wanted to figure out if changing the routine is the best way to go or we do have a function !
Post Reply