Generating sequence numbers using Stage variables
Moderators: chulett, rschirm, roy
Generating sequence numbers using Stage variables
Hello friends,
Can someone please help me with the generation of sequence numbers using Stage Variables?
In the begining of the job, we read the Max number from a table and want to generate a sequence based on the Max number
For example, if the Max number is 100 then we are interested in generating a sequence starting from 101
Any help would be highly appreciated
Thanks
Yamini
Can someone please help me with the generation of sequence numbers using Stage Variables?
In the begining of the job, we read the Max number from a table and want to generate a sequence based on the Max number
For example, if the Max number is 100 then we are interested in generating a sequence starting from 101
Any help would be highly appreciated
Thanks
Yamini
-
- Participant
- Posts: 27
- Joined: Thu Aug 25, 2005 6:33 am
Re: Generating sequence numbers using Stage variables
Hi,
Take a stage variable v, assign a value to it i.e in u r case max number. Take another variable v1 and in the derivation set v1=v+1.
then use v1 for u r sequence. i guess this will work.
If not experts can correct me...
Take a stage variable v, assign a value to it i.e in u r case max number. Take another variable v1 and in the derivation set v1=v+1.
then use v1 for u r sequence. i guess this will work.
If not experts can correct me...
SASI
Re: Generating sequence numbers using Stage variables
Hi Sasi,
Unfortunately it didn't work. Instead of incrementing the sequence by 1 the second variable just added 1 to the first variable(Max number)
Yamini
Unfortunately it didn't work. Instead of incrementing the sequence by 1 the second variable just added 1 to the first variable(Max number)
Yamini
Re: Generating sequence numbers using Stage variables
If @INROWNUM=1 then v+1 Else v1+1 to v1 should work here.yaminids wrote:Hi Sasi,
Unfortunately it didn't work. Instead of incrementing the sequence by 1 the second variable just added 1 to the first variable(Max number)
Yamini
Success consists of getting up just one more time than you fall.
Generating sequence numbers using Stage variables
Hi Anand,
As you might know that the routine KeyMgtGetNextValue will generate the sequence starting from a fixed value. I am interested in generating the sequence starting from a value which is determined during the job's execution
Yamini
As you might know that the routine KeyMgtGetNextValue will generate the sequence starting from a fixed value. I am interested in generating the sequence starting from a value which is determined during the job's execution
Yamini
Re: Generating sequence numbers using Stage variables
Thanks a lot for your help. It worked!If @INROWNUM=1 then v+1 Else v1+1 to v1 should work here.
Yamini
Hi yamini,
Can you please tell me how it works.
Actually i tried it and it has loaded only two record and then it is giving Unique constraint violation since job is trying to load duplicate sequence number.
We have created two Stage variables and in the out put column. we have derived
Can you please tell me how it works.
Actually i tried it and it has loaded only two record and then it is giving Unique constraint violation since job is trying to load duplicate sequence number.
We have created two Stage variables and in the out put column. we have derived
like this.If @INROWNUM=1 then v+1 Else v1+1
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This is a server job.
I would not bother with stage variables at all. I would pass in the maximum value as a job parameter and use the expression
I would not bother with stage variables at all. I would pass in the maximum value as a job parameter and use the expression
Code: Select all
jpMaxKeyValue + @INROWNUM
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.
ray.wurlod wrote:This is a server job.
I would not bother with stage variables at all. I would pass in the maximum value as a job parameter and use the expression...Code: Select all
jpMaxKeyValue + @INROWNUM
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 81
- Joined: Tue Aug 15, 2006 8:31 am
- Location: Zürich
- Contact: