Numbers Sequence

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
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Numbers Sequence

Post by kommven »

I like KeyMgtGetNextValue.
Can you tell me how to reset it?
KeithM
Participant
Posts: 61
Joined: Thu Apr 22, 2004 11:34 am
Contact:

Post by KeithM »

You can reset it through the command line in the administrator. The command is: UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'key_you _want_to_reset';
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

KeyMgtGetNextValue stores values in a hash file named SDKSequences. You could CAREFULLY update the values in this file.

I suggest you start by trying to view the file first. Create a job as follows:

Code: Select all

HASH ----> XFR  ----> SEQ (later add a HASH output, too)
Define two columns in your input hash file stage: KEY which is your key column (a varchar), and VALUE which is the value associated with the KEY (an integer).

Now just VIEW DATA. Get a feel for the file. By updating this file, you can reset the values. Practice writing to a sequential file, and before you make this a production job, include a sequential output file that reports the old and new values, so you have a recovery option.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

We have a job with 2 parameters TableName and ColumnName. The value of the hash file key is always TableName so all it does is route this one value to the hash file.

select max(#ColumnName#) from #TableName#

This is my source query.
Mamu Kim
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Post by kommven »

I think doing SQL will retard my process. I will try with reset thing, Thanks Keith.

Any more suggestions? PLEASE
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

A surrogate key is a primary key. So if you select Max() on it then it returns very fast. The job in question is a multiple instance job. It is called by all our jobs. The instance id is set to the TableName. Works great. I think someone at ASCL originally wrote it.
Mamu Kim
Post Reply