# How to save separate output files when iterating a model?

I need to run a model in model builder 1000 times in order to obtain the average distance of random points in a wildlife species' home range to anthropogenic features. I need to find the average of the random points from EACH of the iterations. However, when running the model 1000 times, the output file is continuously being replaced, so you only end up with one output table, the very last output table. Does anyone know how I can use model tools in order to force the model to save separate files for EACH iteration so that I can find the average distance of the random points to the features for EACH iteration? Thank you very much, any help would be hugely appreciated! I cannot seem to find ANYTHING online about this problem!

-

Treat your output as temporary and allow it to be replaced each time. Start with an empty master table with the same fields as your outputs, ready to receive your output and use Append to copy the temporary output into the master table.

This will give you a table with all of the outputs.

If you are using iteration as stated here (for value = x to y iteration) use the variable in %%, their example is %value%.

-

One approach is to save the output to the in_memory workspace, which will be much faster than writing to disk. You can use the %n% inline variable to provide a unique name (i.e. the iteration number) for each in_memory object:

in_memory\out%n%

You can use the same inline variable to save physical copies to disk so that you are not overwriting output:

C:\path\to\out%n%

-

Also possible to use MERGE each output file to the last, using a feedback loop.

http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Iteration_using_feedback

-