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.
User-defined value in SDKSequences
Moderators: chulett, rschirm, roy
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.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.Beware that DataStage/SQL is case sensitive.
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');
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.