Page 1 of 1

Looping on a sequential file

Posted: Thu Apr 26, 2007 1:30 pm
by Benouche
Hello,

I need to loop on a job by setting a parameter from a list of value stored in a sequential file. i.e. I want to launch the job one time for each line of my file.

Can I achieve this using the loop feature in the sequencer ?

Thanks,

Benouche

Posted: Thu Apr 26, 2007 1:51 pm
by DSguru2B
Sure you can. Have an execute command stage do a cat of the file which has the list in a delimitted format (pre-massage the file if its not in that format). Connect this command stage to start loop and in the list specify #Execute_Command_Stage.$CommandOutput#.
Another way would be to build a server job that reads the sequential file and inside the transformer fire off the routine "UtilityRunJob()". This way a job will be fired the number of times a record comes in.
Another way would be to code this entire thing as a batch job.
Yet another way would be to write a small shell that does this.

Posted: Thu May 03, 2007 10:41 pm
by JoshGeorge
Read the Total count of rows in seq file using Exe Cmnd
Start a loop (1 to count), read current loop number line from the seq file using UVactivity (Write a routine to read seq file) and pass it as parameter to your Job.
In case of Multi Instance this job call should be a routine which will start an instance of the job with the parameter and runs independently