BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Can someone please advise how to print SAS code in color? Thanks!
5 REPLIES 5
Cynthia_sas
SAS Super FREQ
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
wensui
Calcite | Level 5
try vim (www.vim.org). I always use it to print SAS or other program in color.
deleted_user
Not applicable
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.
deleted_user
Not applicable
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
David_SAS
SAS Employee
The corrected URL is

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

-- David Kelley, SAS

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 5769 views
  • 0 likes
  • 4 in conversation