sponsor Vim development Vim logo Vim Book Ad

SAS Syntax : Syntax Script for SAS 9.1/9.2/9.3/9.4

 script karma  Rating 158/59, Downloaded by 7277  Comments, bugs, improvements  Vim wiki

created by
Zhenhuan Hu
 
script type
syntax
 
description
This script was inspired by the script written by James Kidd.
The script has since been completely rewritten.

Upgrade version to 3.0.0. Improvements include:

- Improve sync speed
- Largely enhance precision
- Update keywords in the latest SAS (as of Mar 2017)
- Add syntaxes for date/time constants
- Add syntax for data lines
- Add (back) syntax for TODO in comments

New feature in 2.1.0

- Add syntax fold

Major improvements in 2.0:

- Higher precision
- Faster synchronization
- Separate coloring for control statements
- Highlight macro variables in double quoted strings
- Update all keywords based on SAS 9.4
- Add complete SAS/GRAPH and SAS/STAT procedure syntaxes
- Add Proc TEMPLATE and GTL syntaxes
- Add complete DS2 syntaxes
- Add basic IML syntaxes
- A lot of other improvements and bug fixes

Improvements inherited from version 1.0:

- Add new keywords, including those for ODS and hash object
- Highlight format tags
- Highlight user defined macro functions
- Highlight macro comments

Screenshot: http://imgur.com/QelHtXy

Please also check out my SAS indent script: http://vim.sourceforge.net/scripts/script.php?script_id=4034
 
install details
You can simply copy the script file to your ~/.vim/syntax

To make syntax folding work, you would need to add "set foldmethod=syntax" in your vimrc, or "setlocal foldmethod=syntax" in your SAS ftplugin script.

You can find my SAS ftplugin script from here (along with some other stuffs): https://github.com/akanosora/vimfiles/tree/master/ftplugin
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
sas.vim 3.0.0 2017-03-10 6.0 Zhenhuan Hu Upgrade version number to 3.0. Improvements include:
- Improve sync speed
- Largely enhance precision
- Update keywords in the latest SAS (as of Mar 2017)
- Add syntaxes for date/time constants
- Add syntax for data lines
- Add (back) syntax for TODO in comments
sas.vim 2.1.1 2017-02-09 6.0 Zhenhuan Hu Bug fixes
sas.vim 2.0.4 2016-11-21 6.0 Zhenhuan Hu Add highlighting for functions
Change the implementation of syntaxing macro function names so that macro parameters same as SAS keywords won't be highlighted (Thank Joug Raw for the suggestion)
Add section highlighting:
- Use /** and **/ to define a section
- It functions the same as a comment but with different highlighting
sas.vim 2.0.1 2016-09-07 7.0 Zhenhuan Hu Minor code tweaks.
sas.vim 2.0 2016-07-11 7.0 Zhenhuan Hu Major changes so upgrade version number to 2.0
Overhaul the entire script. Improvements include:
- Higher precision
- Faster synchronization
- Separate coloring for control statements
- Hightlight macro variables in double quoted strings
- Update all syntaxes based on SAS 9.4
- Add complete SAS/GRAPH and SAS/STAT procedure syntaxes
- Add Proc TEMPLATE and GTL syntaxes
- Add complete DS2 syntaxes
- Add basic IML syntaxes
- Other improvements and bug fixes
Drop support for earlier versions of VIM
sas.vim 1.2.5 2015-03-30 7.0 Zhenhuan Hu Added new statement keywords. Updated some keywords to SAS 9.4.
sas.vim 1.2.4 2014-06-19 7.0 Zhenhuan Hu Improved macro comment syntax (macro comments after semicolon is now correctly colored.)
sas.vim 1.2.3 2013-07-25 7.0 Zhenhuan Hu Minor cosmetic modifications for hash objects
Minor bug fixes for statment syntax
sas.vim 1.2.2 2012-04-26 7.0 Zhenhuan Hu Fixed minor bugs.
sas.vim 1.2.1 2012-03-28 7.0 Zhenhuan Hu Added syntax for macro comment
sas.vim 1.2 2012-02-28 7.0 Zhenhuan Hu Completely rewrote approach for highlighting SAS statements
Updated new statements in Base SAS 9.3 and SAS/Stat
Fixed glitches in highlighting procedure names and internal variables.
Simplify the approach for highlighting SAS functions
Added highlighting for hash and hiter objects
sas.vim 1.1 2011-05-11 7.0 Zhenhuan Hu Added more keywords in SAS 9.1.
sas.vim 1.0 2011-03-25 7.0 Zhenhuan Hu Initial upload
ip used for rating: 18.221.165.246

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github