Using source control management with SAS Enterprise Guide

I work on a variety of projects at SAS, most of which require some level of team collaboration in source management systems. Due to the many technologies that we work with, SAS developers use different source management tools for different purposes. I’ve got projects in CVS, Subversion, and Git.

When it comes to writing and maintaining SAS programs (are you ready for this shocker?), I use SAS Enterprise Guide almost exclusively. I know how to use all of the other tools, but this is where I’m most productive.

So, here’s the question that I hear all of the time: Does SAS Enterprise Guide integrate with a source control system? The answer is No. But, it does integrate with the Windows file system. And the Windows file system integrates with source control.

Frankly, this approach is how I prefer to work anyway. Probably due to bad past experiences with source control integration in other IDEs, I prefer to deal with source control on the file system. When my content is ready to commit, I use the file system integration (usually in the form of Windows shell extensions) to review the commit, check differences and history, manage file merges (if needed), and actually commit the files.

For example, here is a picture of one of my project directories where we’re using Subversion. I’m using TortoiseSVN to access the repository. You can see the icon overlays that indicate the files that are up-to-date (green checks) and those that are modified locally (red exclamation).

How to enable relative file references

SAS Enterprise Guide allows you to link in SAS programs and external data files (such as Excel or CSV files), so you don’t have to lock up all of your content in the project (EGP) file. When working with source control, you need to enable one additional trick: tell SAS Enterprise Guide to treat these file references as relative paths. (There’s nothing like an absolute file path — specific to your machine — for messing up your collaboration effort.)

This setting is maintained per project. To set it:

  1. Select File->Project Properties. The Properties window appears.
  2. Select the File References tab.
  3. Check the box: “Use paths relative to the project for programs and importable files”

An example on github

To prove that this actually works, I “refactored” one of my own projects to share with you. It’s the project that analyzes my Netflix rental/streaming history. I placed the Excel files in a “./data” subfolder, and all of the SAS programs in a “./programs” subfolder. These assets, combined with the process flow “recipes” within the project, should allow anybody to re-run my project and to replicate my results. (Note: these projects do assume a Local SAS session. If you don’t have a Local SAS, you must use Tools->Project Maintenance to replace the server references for your environment.)

The projects (one for v4.3, one for v5.1) are in this github repository. Git is fast becoming the most popular source control repository for all types of developers, so it doesn’t get much more modern than this. If you’re brave and you have some time to kill, give it a try. And please, don’t be too critical of my movie rental history.

tags: CVS, github, SAS Enterprise Guide, scm, source control, Subversion