This is not proc report, this is part of a data step that creates text output. In this case, it is used to create MIME/HTML/XML code "manually", without using SAS ODS or other helpers.
Since important parts of the code are missing (the start of the macro definition, for instance, and parts of the data step), it is not possible to thoroughly help you.
One thing that stands out is a run; statement right in between, followed immediately by another put; sequence. This can't work, as you need a new DATA statement after the step boundary caused by the run;
To further understand the code, one would also need the dataset that is used as base for the data step.
... View more