The SAS Output Delivery System and reporting techniques

Print SAS code in color

Reply
N/A
Posts: 0

Print SAS code in color

Can someone please advise how to print SAS code in color? Thanks!
SAS Super FREQ
Posts: 8,866

Re: Print SAS code in color

Posted in reply to deleted_user
Hi,
According to this Tech Support note, SAS code does not print in color from the Enhanced Editor window:
http://support.sas.com/techsup/unotes/SN/003/003804.html

The note suggests that you cut and paste your code into a word processor (or text editing application that does support color printing) and print from there.

cynthia
Occasional Contributor
Posts: 6

Re: Print SAS code in color

Posted in reply to deleted_user
try vim (www.vim.org). I always use it to print SAS or other program in color.
N/A
Posts: 0

Re: Print SAS code in color

Printing code in color is a great help for a code-review session. Microsoft Word provides a lot of what we want for this.
It involves more than 5 minutes preparation, but that would be consistent with preparation for code-review.
Expect to use file-path/name (bold) on the header and version-date-time on the footer.
Rather than just paste the code to a new document, open the saved code, and then replace it all with that color-formatted code from the SAS code window. (It might be wise to ensure tabs are replaced by spaces using the SAS code editor options.) In this way the Word "autotext" carries filename with path.
Page numbers are not needed, because you can print line numbers (thanks to word pageSetup-layout). To keep all under control, alter the linenumber style to something like 8 point Arial. Beware that Word linenumbers increment where long-lines wrap, so either avoid that, or alter the formatting to a smaller font. Wide trailing comments take much less space in Arial or Arial-narrow or small point sizes, while remaining readable. If the code must remain wide in general, you may need/want to go to landscape orientation. For just a few wide lines that wrap, remove nearby blank lines. The convenience of direct addressing using line numbers within a large program is worth preserving.

All this effort seems well rewarded when the code review session quickly passes through long and complex processes with relative ease.
Ususal rules apply ~ respect the audience !

If you need this approach often, it may be worth preparing a special SAS Appearance-scheme.


It works for me, but your experience may be different.
N/A
Posts: 0

Re: Print SAS code in color

Posted in reply to deleted_user
I use MELS (Multi-Edit Lite for SAS). It is a programmer's editor that will print the code in color and much more. You can try it for free:
http://www.multiedit.com/MeLS-info.php
SAS Employee
Posts: 174

Re: Print SAS code in color

Posted in reply to deleted_user
The corrected URL is

http://www.multiedit.com/MeLS-info.php .

-- David Kelley, SAS
Ask a Question
Discussion stats
  • 5 replies
  • 2657 views
  • 0 likes
  • 4 in conversation