You could be interested in the dedicated object that does this sort of things.
https://communities.sas.com/t5/ODS-and-Base-Reporting/The-DATA-step-ODSOUT-object/td-p/87686
http://support.sas.com/resources/papers/proceedings10/072-2010.pdf
... View more