Problem with state file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
srds2
Premium Member
Premium Member
Posts: 66
Joined: Tue Nov 29, 2011 6:56 pm

Problem with state file

Post by srds2 »

I am facing a issue while using the surrogate key in the transformer, i am reading the max value from a column of a table and updating the surrogate key in the first job which runs in the sequential mode. the settings for the surrogate key generator stage in the job 1 are
key source updated action = update
source type = flat file

the max value that would be updating surrogate key is 10000.
So in job 2 when i am using the same surrogate key in transformer stage i was expecting the value more than 10000. But i am getting two sets for values one staring from 10000 and other starting from 1. how to generate only values greater than 10000?

i have went through the below link but didn't solved my problem.

viewtopic.php?t=127081

Even after deleting and recreating the state file it didn't helped me.
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

How is that 10000 passed to the Surr.Key stage and in the job which generates surrogate key (assuming job 2),whats the option selected for Generate Key from Last Highest Value property?
N.Srinivas
India.
srds2
Premium Member
Premium Member
Posts: 66
Joined: Tue Nov 29, 2011 6:56 pm

Post by srds2 »

10000 passed to the Surr.Key stage and in the job which generates surrogate key --we getting maximum value from table and updating the state file.

In the job 2 we were using transformer stage we were not using surrogate key generator stage .There is no option like Generate Key from Last Highest Value property in transformer stage
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,
There is no such option in Transformer.In Transform it will generate unique number but never guarantee that it will be higher then your last max value.
srds2
Premium Member
Premium Member
Posts: 66
Joined: Tue Nov 29, 2011 6:56 pm

Post by srds2 »

prasson_ibm wrote:Hi,
There is no such option in Transformer.In Transform it will generate unique number but never guarantee that it will be higher then your last max value.
Prasson_ibm: In Transform it will generate unique number
Even we had thought same thing but issue we are facing is generating back old keys like starting from 1 which were already inserted in table in previous runs.
Do you any other way to generate key from 10000 in transformer other than using surrogate key generator stage using generate Key from Last Highest Value property to YES
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Pass this 10000 value as a parameter to Initial value in the transformer and run the job.
Post Reply