Static 'SAS' Code Analysis

A static code analysis tool for 'SAS' scripts. It is designed to load, count, extract, remove, and summarise components of 'SAS' code.

Travis-CI Build Status

  • Extract counts of proc and data steps
  • Summarise SAS files


sasPath <- system.file('examples/SAScode/Macros/fun2.SAS', package='sasMap')



  • Renamed and rewrote many core functions
  • Moved network/plotting/app features to dev

  • Rewrote core function parseSASscript() so it calls small functions separately. Specifically, improved algorithm of comment removal, added micro define/calls so the stats information is more accurate.
  • Added unit tests
  • Added dependency on stringi for its handy manipulation of regular expressions
  • Interactive network improved. Top level scripts, low level scripts and macros can be visually distinguished.
  • Added a shiny app.
  • Specified license.

  • Amended search for proc calls so doesn't have false positives for words which start with "proc" (thanks @thisisnic)

  • Added a new column indicating number of macros defined in each script to output of pasrseSASscript()
  • Added example figures to README
  • Split drawProcs() into two functions - listProcs() and drawProcs(), and both are exported to user

Initial Github release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.0.0 by Nic Crane, 4 years ago

Report a bug at

Browse source code at

Authors: Nic Crane [aut, cre] , Ava Yang [aut] , Richard Pugh [aut] , Gregoire Gauriot [aut] , Jinjing Xie [aut] , Mango Solutions [cph]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports readr, stringr, stringi

Suggests testthat, markdown

See at CRAN