About INROWNUM Variable

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
swetha007
Participant
Posts: 2
Joined: Mon Apr 10, 2006 5:36 am

About INROWNUM Variable

Post by swetha007 »

How can i findout Unique values Using INROWNUM.
Using INROWNUM in transformer stage i am getting partitionwise records count.

Thanks
Swetha
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

What exactly you need to get?
@PARTITIONNUM will give the partition number for the particular instance.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

You can calculate which row number you are processing using a combination of INROWNUM, PARTITIONNUM and NUMPARTITIONS.

Remember though that unless your data is partitioned evenly there will be gaps in the numbers as one partition has more records than another.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Even the data is not well partioned, the ROWNUM will give the number of row passed in/out of the partiton. So there shouldnt be any gaps if you considire altogether.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

... and as a result there will be gaps when considered as a whole.

Let me explain. If there are 2 partitions, the first has two rows and the second has 5 rows.

The first partition would count using a calculation that started counting at 1 and went up by 2 for each row.
The second partition would start at 2 and go up by 2 for each row.

Thus the counts would be 1,3
and 2,4,6,8,10

Giving a combined 1,2,3,4,6,8,10 and there are therefore gaps because the partitions are not balanced.
Post Reply