KeyMgtGetNextValueConcurrent
Moderators: chulett, rschirm, roy
KeyMgtGetNextValueConcurrent
How can we generate same value in col2 for one family of records.
the current job is using KeyMgtGetNextValueConcurrent to generate col2
col1 col2
456318#16#1 6578
456318#16#2 6580
456318#16#3 6582
col1 col2
784654#19#1 6598
784654#19#2 6600
784654#19#3 6602
Any idea
the current job is using KeyMgtGetNextValueConcurrent to generate col2
col1 col2
456318#16#1 6578
456318#16#2 6580
456318#16#3 6582
col1 col2
784654#19#1 6598
784654#19#2 6600
784654#19#3 6602
Any idea
-
- Participant
- Posts: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact:
Code: Select all
I am generating a sequential number by using KeyMgtGetNextValueConcurrent
for example
col1 col2
456318#16#1 6578
456318#16#2 6580
456318#16#3 6582
784654#19#1 6584
784654#19#2 6586
784654#19#3 6588
814544#20#3 6590
826545#21#3 6592
835646#22#3 6594
I want the same sequential number to be assigned for a group of records( i am grouping based on first 2 positions in col1)
col1 col2
456318#16#1 6578
456318#16#2 6578
456318#16#3 6578
784654#19#1 6580
784654#19#2 6580
784654#19#3 6580
814544#20#3 6590
826545#21#3 6592
835646#22#3 6594
Any idea
Last edited by dsuser91 on Wed Aug 18, 2010 1:36 pm, edited 1 time in total.
-
- Participant
- Posts: 63
- Joined: Fri Jun 22, 2007 7:27 am
- Location: Kolkata
split your output to aggregator
then lookup seq file with hash file
Code: Select all
input ----- xfm ---------seqfile
|------- srt ----- aggregator ---- xfm(use keymgmy) ---- hashfile
-
- Participant
- Posts: 63
- Joined: Fri Jun 22, 2007 7:27 am
- Location: Kolkata
OR
you can use the same as mentioned,
you can use the same as mentioned,
And the point 3 needs to be changed to something likearunkumarmm wrote:Sort your input records before the transformer and inside the transformer
1. svOld: svNew
2. svNew: <KeyColumn>
3. svCol2: If svOld <> svNew Then svCol2 + 1 Else svCol2
Map this svCol2 to your Col2
Code: Select all
3. svCol2: If svOld <> svNew Then KeyMgtGetNextValueConcurrent Else svCol2
I did a modification to stagevar
If lkp.NOTFOUND and svOld <> svNew Then KeyMgtGetNextValueConcurrent Else lkp.ID
I am assiging value for the first record olny, because the the next 2 records fall under the svOld = svNew condition
How can i handle this?
Thanks
(no clue why the entire post was wrapped in code tags so I 'corrected' it - Moderator)
If lkp.NOTFOUND and svOld <> svNew Then KeyMgtGetNextValueConcurrent Else lkp.ID
I am assiging value for the first record olny, because the the next 2 records fall under the svOld = svNew condition
How can i handle this?
Code: Select all
col1 col2
784654#19#1 6580
784654#19#2
784654#19#3
(no clue why the entire post was wrapped in code tags so I 'corrected' it - Moderator)
Little tweak would do
Sort the data based on the key column.
Pass to Transformer.
Default the stage variables to emptly string
svNew = ''
svOld = ''
svSerialNp = 0
Sort the data based on the key column.
Pass to Transformer.
Default the stage variables to emptly string
svNew = ''
svOld = ''
svSerialNp = 0
Code: Select all
1. svNew: Col1[0,Index(Col1,'#',2)]
2. svSerialNo: If svNew = svOld Then svSerialNo Else KeyMgtGetNextValueConcurrent
3. svOld = svNew
Last edited by kumar_s on Wed Aug 25, 2010 8:57 am, edited 1 time in total.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'