Hi all
I was trying to generate surrogate key thru surrogate key generator stage . I had provided key source name (state file name along with path) as "/dbload01/test/vendor/surr_key.txt" which is present in my UNIX Server and that file is of one line and contains only one character '1' which will be my initial value for the surrogate key.But i am getting the error message as "Surrogate_Key_Generator_21,0: Unable to read state file /dbload01/test/vendor/surr_key.txt: Invalid argument.". Should this file be present in windows drive?? need advice from anyone. from help file of surrogate stage I found that value of key source name is an address of windows drive like "C:\SKG\ProdDim".
I read all the post for this topic related to "surrogate key". But no one have given information about key source name.
"srimitta" is one the user from this forum who was trying the same as i am doing. But I think she is unresolved till now.
surrogate ket generator stage
Moderators: chulett, rschirm, roy
surrogate ket generator stage
Goutam Sahoo
Re: surrogate ket generator stage
It needs to be local to your DataStage server, regardless of platform. What's in the help is just an example.goutam wrote:Should this file be present in windows drive??
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: surrogate ket generator stage
chulett wrote:It needs to be local to your DataStage server, regardless of platform. What's in the help is just an example.goutam wrote:Should this file be present in windows drive??
Thanks craig. You are saying it is regardless of the platform and should be local to my datastage server. Then please tell me is there anything wrong in my case. ?? I have also provided the path which is local to datastage server.
OR should I give the path where datastage is installed. i.e
"/IBM/IIS 8.0.1/"
Please guide me the correct way.
Goutam Sahoo
Sorry, if I had had more to add I would have. I don't have access to 8.x nor PX at the moment, and the 7.x docs don't mentioned anything about using a file that I can see - only an optional job parameter to seed the sequence.
And no, you wouldn't use your install path unless that's where your file is. Obviously you need to provide the correct path to the file regardless of where it is. From the example you posted, perhaps all you need for the 'path' is the directory where the file lives? And then put the actual filename somewhere else? Heck if I know, just guessing at this point.
Someone else is going to have to help out with the specifics for that option.
And no, you wouldn't use your install path unless that's where your file is. Obviously you need to provide the correct path to the file regardless of where it is. From the example you posted, perhaps all you need for the 'path' is the directory where the file lives? And then put the actual filename somewhere else? Heck if I know, just guessing at this point.
Someone else is going to have to help out with the specifics for that option.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: surrogate ket generator stage
You will first need to create a surrogate key source through a separate job throwing only the SK key gen stage in that job. It will allow you to specify the namd and location of the SK source key.
Now, that you have created it you will need to access/point to the source everytime.
You will now need to access the source through a SK key stage/Transfoermer each time through your transformation DS job. Remember to set it to generate from last highest value.
You will also now need to point it to the source file SK file location.
Now, that you have created it you will need to access/point to the source everytime.
You will now need to access the source through a SK key stage/Transfoermer each time through your transformation DS job. Remember to set it to generate from last highest value.
You will also now need to point it to the source file SK file location.
Re: surrogate ket generator stage
ds_is_fun wrote:You will first need to create a surrogate key source through a separate job throwing only the SK key gen stage in that job. It will allow you to specify the namd and location of the SK source key.
Now, that you have created it you will need to access/point to the source everytime.
You will now need to access the source through a SK key stage/Transfoermer each time through your transformation DS job. Remember to set it to generate from last highest value.
You will also now need to point it to the source file SK file location.
Thanks, I have created the state file using surrogate key generator stage with file initial value 1. When I opened the file I saw that file is populated with 1 column and 10 rows.
1
2
3
4
5
6
7
8
9
10
But the strange thing is that when I used that file for populating the surrogate key, the key value got started from ten digit number. How can I populate the same from 1 onwards. Please suggest some ideas....
Goutam Sahoo
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Re: surrogate ket generator stage
goutam wrote:ds_is_fun wrote:You will first need to create a surrogate key source through a separate job throwing only the SK key gen stage in that job. It will allow you to specify the namd and location of the SK source key.
Now, that you have created it you will need to access/point to the source everytime.
You will now need to access the source through a SK key stage/Transfoermer each time through your transformation DS job. Remember to set it to generate from last highest value.
You will also now need to point it to the source file SK file location.
Thanks, I have created the state file using surrogate key generator stage with file initial value 1. When I opened the file I saw that file is populated with 1 column and 10 rows.
1
2
3
4
5
6
7
8
9
10
But the strange thing is that when I used that file for populating the surrogate key, the key value got started from ten digit number. How can I populate the same from 1 onwards. Please suggest some ideas....
goutam,
You just have to do is create a zero byte file using touch command.
Then use that as a state file in surrogate key generator stage and let datastage initialize that file for you.
then it will generate keys from 1.
Regards,
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Best practice is, I believe, to create a dedicated directory within your project in which to store state files, and to supply that directory's pathname to the job as a job parameter.
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.