Reset the loop when processing data

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Chandrathdsx
Participant
Posts: 59
Joined: Sat Jul 05, 2008 11:32 am

Reset the loop when processing data

Post by Chandrathdsx »

Hi,

I have a job sequence design that runs in loop for x times with two branches, branch1, if no files to process then it does sleep and keep on running in loop. branch2, if there are files to process then reset the loop limit to start the counter from 1 to run for x times.
Basically I want to run the job x times only when there are no files.
I need help on how to reset the loop counter to start from 1 when the files exist to process?
The requirement is loop the job x times only when there is no files. otherwise (if files are there, keep processing files) x times condition does not apply here. we get the files at regular interval and we have an end of file marker to exit loop if nothing more to process.
Any help is greatly appreciated on how to reset the loop limit counter depending on file exists to process.

Thanks
mkiru23
Premium Member
Premium Member
Posts: 33
Joined: Thu Nov 20, 2003 4:33 pm
Location: SFL

Re: Reset the loop when processing data

Post by mkiru23 »

Setup another stage to check if condition is satisfied in the trigger then send to end stage.
Chandrathdsx
Participant
Posts: 59
Joined: Sat Jul 05, 2008 11:32 am

Re: Reset the loop when processing data

Post by Chandrathdsx »

Thanks for the reply..

But, if condtion not satisfied? the loop has to keep running for all it's iterations. I only want to reset the loop counter back to 1 (start of loop) if the data files exist... In another way I want to capture how many times the loop ran with no files and I do not need to increment the loop counted when the file exists.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no way to reset the loop index variable.

You can design to bypass activities.

Code: Select all

---> Start Loop  <---------------------------------- End Loop
         |                                              ^
         |                                              |
         V                                              |
   Nested Condition  ----->  Job Activity  ----->  Sequencer
         |                                              ^
         |                                              |
         +----------------------------------------------+
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply