User-defined value in SDKSequences

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
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

User-defined value in SDKSequences

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

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Great!! Works...just as I needed. Thanks Ray and Arnd.
Post Reply