Page 1 of 1

Create file first time and then append to it

Posted: Tue Sep 06, 2011 1:21 pm
by pdntsap
Hello,

I have a job that has a start and end loop acitivity and a bunch of steps being repeated n times. I need to create/overwrite an output file when the loop is executed the first time and then append to the same file for subsequent iterations of the loop. What are some of the possible ways of doing this?

Thanks.

Posted: Tue Sep 06, 2011 1:28 pm
by chulett
Append will create the file if it doesn't exist. But that will also mean it will append to the previous run's file rather than replace it so you'll need an extra step. Before you get into your loop, ensure the file generated by the previous processing run has been deleted.

Posted: Tue Sep 06, 2011 1:41 pm
by pdntsap
Thanks Craig.

I will implement your suggestion and update my post accordingly.

Posted: Fri Sep 09, 2011 9:53 am
by arunkumarmm
You can also have two identical output stages in your job, pass your counter value as a parameter to determine the start of the loop and have one stage create (Overwrite) the file and the other stage append to the file for subsequent runs by having proper constrains.