DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
This topic has been marked "Resolved."
Author Message
dsadm_ws



Group memberships:
Premium Members

Joined: 12 Apr 2010
Posts: 65

Points: 658

Post Posted: Mon Jun 06, 2011 9:08 am Reply with quote    Back to top    

DataStage® Release: 8x
Job Type: Parallel
OS: Unix
Have anyone come across this issue.

I am trying to generate a surrogate key using the following logic in my transformer which works fine:

@PARTITIONNUM + ( @NUMPARTITIONS * (@INROWNUM - 1) ) + 1

However, it's using only one 1 instance on 2 nodes(using a dataset in the downstream).

Thanks!
jwiles



Group memberships:
Premium Members

Joined: 14 Nov 2004
Posts: 1236

Points: 9942

Post Posted: Mon Jun 06, 2011 9:31 pm Reply with quote    Back to top    

So, do you have a question or problem?

_________________
- james wiles


All generalizations are false, including this one - Mark Twain.
Rate this response:  
Not yet rated
Gokul
Participant



Joined: 23 Feb 2005
Posts: 74
Location: Mumbai
Points: 719

Post Posted: Mon Jun 06, 2011 11:36 pm Reply with quote    Back to top    

Datastage works within nodes. Hence your surrogate key generator logic would work if either it is run one instance or the rows are equally distributed accross all the partitions.


To generate , unique consecutive values in datastage
a> we used to use transformer ( with partition number and number of partitions used) in sequential mode.
or
b> the columne generator in sequential mode.
Rate this response:  
Not yet rated
dsadm_ws



Group memberships:
Premium Members

Joined: 12 Apr 2010
Posts: 65

Points: 658

Post Posted: Wed Jun 08, 2011 1:14 pm Reply with quote    Back to top    

I finally found out what the problem was.

I am running my job on two nodes and before generating the SK i was using Hash Partitioning.

And this was placing all the records in one dataset.

So, tried with round robin, and it worked like a magic.

Thanks Again for all the inputs.
Rate this response:  
Not yet rated
pprakash
Participant



Joined: 09 Aug 2012
Posts: 3
Location: Bangalore
Points: 32

Post Posted: Mon Sep 03, 2012 1:51 am Reply with quote    Back to top    

Just want to add, how "Round Robin Partition" works with the logic below;

This will work!

@PARTITIONNUM + (@NUMPARTITIONS * (@INROWNUM - 1)) + 1


i tried with 3 nodes by with 'Round Robin Partitioning'(there are 9 records). Please find the detailed below;



====> @PARTITIONNUM + (@NUMPARTITIONS * (@INROWNUM - 1)) + 1


Partition 1:-

0+(3*(1-1)+1=1
0+(3*(2-1)+1=4
0+(3*(3-1)+1=7

Partition 2:-

1+(3*(1-1)+1=2
1+(3*(2-1)+1=5
1+(3*(3-1)+1=8

Partition 3:-

2+(3*(1-1)+1=3
2+(3*(2-1)+1=6
2+(3*(3-1)+1=9

_________________
Prakash S Patil
Capgemini
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours