DATA Step, Macro, Functions and more

Preserving Color Coding in Log Window when saving log to a file

Reply
Contributor
Posts: 61

Preserving Color Coding in Log Window when saving log to a file

I am running SAS 9.1.3 Service Pack 4 on WindowsXP Pro platform with Service Pack 3. I have been saving my logs to a file in a specific folder on my hard drive, for future reference. However, the color coding is lost once I do this.

When I need to save SAS code from the Enhanced Editor window into a Microsoft Word 2007 document, the color coding of the code is preserved when I cut and paste into Word. Why does this not work for the Log Window color coding? Is there a way to preserve the color coding, so I can easily see my "ERROR:" and "WARNING:" messages?
Valued Guide
Posts: 632

Re: Preserving Color Coding in Log Window when saving log to a file

This is for windows and untested otherwise.

On your SAS.EXE line add the -RTFCOLOR initialiazation option. Then save your log to an RTF file by one of the following three ways 1) use the SAVE AS pull down under FILE (windows DM). 2) write the log file to an RTF using the command WRTFSAVE "c:\temp\mylog.rtf". 3) use a DM statement such as DM 'log; WRTFSAVE "c:\temp\mylog3.rtf"';

PROC PRINTTO does not do the trick. I have not tried the ALTLOG option.
Art
Valued Guide
Posts: 2,175

Re: Preserving Color Coding in Log Window when saving log to a file

Last August a similar topic http://support.sas.com/forums/thread.jspa?messageID=40482鸢 points to alternative ways of collecting the color attributes that are native to SAS Display Manager.
ArtC provides the more convenient RTFcolor approach which works for me.
Neither approach will support log files created when SAS runs in batch mode which includes SAS Enterprise Guide.
peterC
Contributor
Posts: 52

Re: Preserving Color Coding in Log Window when saving log to a file

The URL doesn't seem to be available anymore.  Is there an alternate way to get to the old community information.

 

Are there a any new solutions with SAS 9.3 and corresponding EB or SAS 9.4?

 

TIA,

Kim LeBouton

Respected Advisor
Posts: 3,777

Re: Preserving Color Coding in Log Window when saving log to a file

Do you know where this is documented? I could not find anything, other than this thread when I search RTFCOLOR at support.sas.com.

I did find this on SAS-L
http://www.listserv.uga.edu/cgi-bin/wa?A2=ind9609C&L=sas-l&P=R2522
Valued Guide
Posts: 2,175

Re: Preserving Color Coding in Log Window when saving log to a file

proc options option= rtfcolor; run; suggests it doesn't exist ;-)
proc options option= rtfcolor define value internal; run; provides very little additional info, but does indicate it is an "invocation-only" option.
The "internal" is emphasised with the additional NOTE:[pre]NOTE: Internal SAS system options facilitate testing, development and problem diagnosis of SAS.
Internal options are not documented or supported. Customer use of internal options is not
recommended, unless specifically directed by SAS Technical Support.[/pre]indicating no documentation is likely.
So, I guess it might be withdrawn at any release.
As long as you can run under Display Manager, I don't think it will disappear.
peterC
Super Contributor
Posts: 273

Re: Preserving Color Coding in Log Window when saving log to a file

I have only found a french sentence
at
[pre]
http://www.sas.com/offices/europe/france/services/support/faq/sasaf.html#AF14
[/pre]
as an AF trick
more precise:

"In your config.sas, the option -$rtfcolor would permit you to preserve the color of the text when you copy SAS text coming from a sas log or scl window."

Andre

Message was edited by: Andre Message was edited by: Andre
Occasional Contributor
Posts: 10

Re: Preserving Color Coding in Log Window when saving log to a file

I wish SAS would make this an option that the user can edit from within the program. I run SAS on a server and cannot make changes to the invocation options or configuration files.

Ask a Question
Discussion stats
  • 7 replies
  • 1735 views
  • 0 likes
  • 7 in conversation