Write SAS Programs in Visual Studio Code

  • SAS
  • SAS Viya
  • SAS 9
  • Visual Studio Code
  • Programming
  • Git
By Paul Shannon

SAS have released a programming extension for Visual Studio Code, meaning SAS programmers can now write, edit, run programs, and view outputs in the popular cross-platform, free IDE. 

What is Visual Studio Code?

First launched in 2015, Visual Studio Code (VS Code) is a source code editor (often referred to as an Integrated Developer Environment (IDE)) which provides a lightweight application for developers and programmers to use for almost any programming language… and yes, that even includes SAS. Users can install VS Code on almost any client; whether running Windows, Linux, or Mac operating systems.  

SAS Extension

VS Code is designed with an API and an extensions marketplace meaning developers can customise/extend VS Code to work in any way that is required. SAS have used this API and marketplace to provide functions for writing SAS programs, running code on a server (or locally) and viewing SAS content.  

Note: The VS Code marketplace is open for anyone to publish content. There are other developers who have attempted to create SAS code editors but are neither developed nor endorsed by SAS. 

SAS Extension Do I need SAS Viya?

The short answer is no. However be aware that SAS Viya offers the best functionality in VS Code, a benefit of microservice architecture and the REST APIs available in Viya means it best serves the extension’s functionality. But SAS 9.4 is now supported for both remote servers (via SSH connections) and a local installation of SAS.  

Programming Window and Output 

The programming window will be familiar to users of VS Code and SAS Enterprise Guide. A rich syntax editor will highlight your programs in a familiar way. SAS output is rendered as HTML (by default in all current SAS releases), so you will be a HTML rendering of reports alongside your program as they are executed.  There is also the addition of a “notebook” style programming environment. 

Similarly, a dataset can be opened using the explorer view (currently for Viya servers).  

Git Integration

One of the many advantages of using VS Code is its native Git integration and Git user interface. VS code makes routine processes in Git virtually seamless to the programmer. As VS Code is a locally installed application, Git repositories are watched and changes identified instantly, making the process of common Git tasks lightning fast.  

The VS Code marketplace further enhances the Git experience, making it easier than ever to use Git source control for your SAS programs. Graphically viewing your Git history is available through many marketplace extensions. 

Open source

The development of the VS Code extension is open source, meaning users can see development actions, issues and contribute to further improvements. The extension is written in the TypeScript language; a strongly typed superset of JavaScript.  The development backlog is openly visible on SAS’ GitHub page. 

Should I Switch? 

Adopting VS Code does not mean you must retire SAS Enterprise Guide, SAS Studio, or any other programming environment you might use. For SAS programmers, VS Code can be a viable option, and its features will only improve over time. Although VS Code does not cover all functionality offered by other SAS Applications such as point and click tools in SAS Studio or Enterprise Guide. Personal preference of your team/individuals may be the biggest driver. Offering multiple client applications such as VS Code, Enterprise Guide and SAS Studio is entirely possible.


If you do want more help on what the best option is for you and your team, the Katalyze Data consultants will be more than happy to discuss your current needs, opportunities and gaps. Then advise the benefits of each of the applications in use. Just get in touch and one of the team will get back to you.

Contact Us
Back to Insights

Related content

Talk to us about how we can help