Programming Resources

Using PROTECTSPECIALCHARS in SAS ODS to allow HTML tags

How to use PROTECTSPECIALCHARS to allow HTML tags in your data when using HTML ODS in SAS

 

 

When sending output to the HTML destination using PROC REPORT a number
of the usual attributes are not available. For example the FLOW attribute
on the DEFINE statement. It can therefore be necessary to include HTML
tags within the data to be interpreted when the HTML page is viewed in a
browser.
The problem is that if for example you enter '<BR />' into your
data then SAS will protect the characters and your output will actually
be converted into character entities eg. '&lt;BR /&gt;'.
The solution is to use the protectspecialchars attribute within style
definitions, which when set to OFF causes SAS to ignore special
characters and output exactly as entered.
An example PROC REPORT statement is shown below, note how the
protectspecialchars is only being applied to the data in this case and so
any special characters in column headers will still be protected.
proc report data=mydata nowindows
style (header) = [font_face=helvetica font_size=2]
style (column) = [font_face=helvetica font_size=1
protectspecialchars=off];

 

Recommended SAS log analyser for SAS users:

Take a look at Elvis SAS log analyser. It takes a SAS log, either from the clipboard or from a saved file, and allows you to view it, navigate around it, search it and more. This makes working with large SAS logs much, much easier and faster than simply looking at the log in a non-specialised viewer such as a plain text editor, Internet Explorer or Notepad.

If you are looking for property in Piemonte Italy then we recommend alba property and piedmont property. Italian real estate.

Home > Programming Resources > SAS > Using PROTECTSPECIALCHARS in SAS ODS to allow HTML tags

Contact

Telephone: 020 7193 2301
Email: webcontact@fearntech.co.uk

Full Contact Details >

 

© 2001-2008 Fearntech Limited. All rights reserved.
website design kent | seo kent | website maintenance
Valid XHTML | Valid CSS