Page 1 of 1

User-defined value in SDKSequences

Posted: Wed Jan 25, 2006 2:05 pm
by gateleys
Hi, I am creating a job so that it updates the SDKSequences file with the value MAX(my_table_key)+1 for the required sequence which is the argument to KeyMgtGetNextValue(). The SDKSequences file in my project folder only contains one field AT.ID, which contains the names of all the sequences in the project. However, it does not have another column which I expected to hold the current value for the sequences. I am using DS 7.0 on Windows.

Of course, I have been able to use the UPDATE statement against SDKSequences via the Administrator to change the NEXT_VALUE as required, but I wanted to automate the process through a job.

Where is the current value of the sequences located? Any help is appreciated.

Posted: Wed Jan 25, 2006 5:06 pm
by ArndW
Hashed files are unlike SQL tables in that the DDL is completely disassociated from the data itself. The first field of the the record in this file does contain the key value you are looking for, but the DICTionary of that hashed file just doesn't contain a reference to it.

Posted: Wed Jan 25, 2006 5:22 pm
by ray.wurlod
Since SDKSequences is a hashed file, navigation is by field number, not by column name.

Create a table definition containing two columns (called, maybe, SequenceName and NextKeyValue), both VarChar with precision 254. Mark the first of these as Key and not null.

Use this table definition in Hashed File or UV stages to access the SDKSequences hashed file.

If you really want, you can populate the SDKSequences file dictionary with these items, but you are likely to lose them when upgrading.

Code: Select all

INSERT INTO DICT SDKSequences(ID, CODE, A2, NAME, FORMAT, SM) VALUES ('SequenceName', 'D', 0, 'Sequence Name', '36T', 'S');
INSERT INTO DICT SDKSequences(ID, CODE, A2, NAME, FORMAT, SM) VALUES ('NextKeyValue', 'D', 1, 'Next Key Value', '36T', 'S');
Beware that DataStage/SQL is case sensitive.

Posted: Thu Jan 26, 2006 7:56 am
by gateleys
Great!! Works...just as I needed. Thanks Ray and Arnd.