Is there any syntaxhighlighter for SAS?

I would simply copy/paste from your editor into a rich text editor (ie, MS Word or similar) that is capable of producing an HTML file. Alternately, some text editors like UltraEdit are capable of doing SAS markup.


I just discovered that Gist actually supports SAS Syntax highlighting!

This is what you see if you create a hello_world.sas file on Gist.

enter image description here

If you'd like to embed SAS codes into (say) a Wordpress.org blog article (like myself), the way I usually do this is:

  1. Create a Markdown file on Gist. For example, see this Gist Markdown file that I created ). Notice that an "embed link" is created for you:

enter image description here

  1. In your Wordpress.org website, already have the plugin oEmbed Gist already installed.

  2. When you create a new blog post in Wordpress, in the body field (where you'd normally type out content of your blog post), simply copy and paste the Gist embedded link into the the body.

enter image description here

  1. Publish that blog post and you shall see it renders beautifully!

enter image description here

(alternatively, if you wish to write your Wordpress blog post normally, and embed multiple Gist SAS codes, just simply save the gist files as .sas files (instead of one .md file), and embed multiple embed URLs (corresponding to each code blogs).

More info see this stackoverflow forum - where I learnt about the awesome Gist and Wordpress Gist oEmbed combo!


As of SAS Entreprise Guide v5.1, you can right-click on the editor window and select 'Copy HTML source to clipboard'.

You can then paste the HTML directly into the HTML source of your page.

Note that this may even work in earlier versions of the SAS Entreprise Guide - version 5.1 just happens to be the version I have installed.

Thanks to @otto for providing the original idea of using Enterprise Guide.