Yes - allocate your file with FILENAME, invoke PROC PRINTTO to re-direct the SAS LIST to the declared , execute your code, as needed, reset PROC PRINTTO, and then issue FILENAME CLEAR.
You may also want to look at ODS LISTING / HTML / PDF / RTF / ... as well, depending on your output formatting requirements.
Scott Barry
SBBWorks, Inc.
Suggested Google advanced search argument to consider:
proc printto site:sas.com
Message was edited by: sbb