What can I add to this code to ensure the results are separated by a
or line? When I run the script the results return which each section on top of the othe with no sperataor so it's hard to determine where the next one starts. All assitance is much appreciated.

How hard is it to modify CopyFields to look at the names being passed and, every time it sees a name that *STARTS* with "PROC_CODE", simply insert a separator?

I do also have to say I don't understand the point of specifying all those fields in the CopyFields function call. Why not simply do CopyFields(desc) to automatically get all the fields noted in your desc "array" (which isn't really an array, but never mind).

On a parallel note: You could have much more neatly and compactly created desc thusly:

Also, I don't understand the point of having "PROC_CODE" for the first instance and then "PROC_CODE1", "PROC_CODE2", etc. Why not be consistent and name the first instances with a zero: "PROC_CODE0", "MEDICARE0", etc.?