System variable @INROWNUM compare with decimal

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
Mat05
Participant
Posts: 4
Joined: Wed Oct 22, 2003 1:56 pm
Location: Montreal, Canada

System variable @INROWNUM compare with decimal

Post by Mat05 »

Hi all,

I am trying to test the variable @INROWNUM in a transformer stage against a number like the following:

If (@INROWNUM <= 300000) Then "2003-12-21" else if (@INROWNUM < 600000) And @INROWNUM > 300000) Then "2003-12-28" else "2004-01-04"

. The job works fine but even if 900 000 rows are being processed. They all get the first option ("2003-12-21") like the row number never goes over 300 000. I tried a lot of variations like putting my number inside quotes or doing a StringToDecimal() on my arguments but it's still the same. Has any of you tried to use @INROWNUM inside a transfomer and if so, how can you access it's numerical value?

Thanks

Mat
bigpoppa
Participant
Posts: 190
Joined: Fri Feb 28, 2003 11:39 am

System variable @INROWNUM compare with decimal

Post by bigpoppa »

Seems like it should work, so I don't know why it's not. Can you look at the compiled transform code and determine what type @INROWNUM is and if it is ever initialized and/or incremented? If you don't know C, just post the code and we'll help you look for it.

If you can't get inrownum to work, try using a row-counter stage variable.

- BP
Mat05
Participant
Posts: 4
Joined: Wed Oct 22, 2003 1:56 pm
Location: Montreal, Canada

Post by Mat05 »

Ok...this is weird. I tried testing if (@INROWNUM < 30)... and it worked! Same for 300, 3000, 30000 but it does not work for 300000!!!! The variable holding @INROWNUM is uint64 .....isn't it 64 bits long??
It should handle 300000 without problems!

Anyway, I will keep it like that.

Thanks for your help BP

Mat
bigpoppa
Participant
Posts: 190
Joined: Fri Feb 28, 2003 11:39 am

System variable @INROWNUM compare with decimal

Post by bigpoppa »

That is weird. Are you planning on filing a bug report with Ascential? We'd like to know the outcome if you do.

Thanks,
BP
1stpoint
Participant
Posts: 165
Joined: Thu Nov 13, 2003 2:10 pm
Contact:

Dividing?

Post by 1stpoint »

Have you tried doing a Divide or modulo on @INROWNUM?
Also, create a Sequential output and move @INROWNUM to it and see what happens if it gets over say 250000.
bigpoppa
Participant
Posts: 190
Joined: Fri Feb 28, 2003 11:39 am

System variable @INROWNUM compare with decimal

Post by bigpoppa »

I'm wondering if you need consider the partition number when you use @INROWNUM. Another other thing to try:

Collect all your data into a single stream and see if the same conversion logic yeilds the correct results.
Post Reply