Outrownum

Dedicated to DataStage and DataStage TX editions featuring IBM<sup>®</sup> Service-Oriented Architectures.

Moderators: chulett, rschirm

Post Reply
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Outrownum

Post by I_Server_Whale »

Hi All,

I have a job which is RTI enabled. Due to my logic, I want to reset the outrownum after each row is processed. Is there any way I can do it, because an RTI job is always running.

Any ideas are tremendously appreciated.

Thanks a lot,

Naveen.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
How about using a stage variable instead?
This way you can initialize it with zero or 1.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you pause to think about what @OUTROWNUM is doing, it is counting the rows that are sent along the output link while the job is running. The job continues to run, because of the RTI components. It follows that the answer to your question ("can I reset @OUTROWNUM", implicitly "without stopping the job") is no.

Roy has identified the obvious alternative. However, what exactly do you want to do? Set it to 1 for every row processed? In that case you don't even need a stage variable; just use the constant in the output column derivation.

Otherwise you will need to consider under what exact conditions you need to reset your counter, and implement detection of those conditions, probably again using stage variables.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

We also faced the same problem. For pagination in the WebService while displaying the data we were using @OUTROWNUM and it was failing because it keeps on incrementing each time you call the we webservice.
I also tried using the StageVariable with initial value as 1, but it was also not working as the job is continuously running, the stage var keeps on incrementing.

The solution is to use a DS macro DSRTIRowCount which works fine and thought the job is running continuously, during each new request to the job, the counter starts from 0.

Hope this helps.
Regards,
S. Kirtikumar.
Post Reply