This is the last of what I planned as a three-part miniseries sharing some thoughts on using SAS Enterprise Guide as a programmer. The first couple posts described what I think of as big benefits of Enterprise Guide: using process flows as a workspace to organize the code in a project; and making it easier to run code on a remote (UNIX) server. This last post is just a collection of little things I like about the Enterprise Guide program editor.
To be clear, I am not trying to convince you that the Enterprise Guide editor is the best editor you can find for writing a SAS program. There are lots of great editors out there, with a range of features. If you’ve got one you love, stick with it. But if you are moving from coding in DM SAS to coding in Enterprise Guide, these are some of the things you might like.
Side note: I wanted to find a big image of Julie Andrews for the top of the post. But I figure images from The Sound of Music are probably still copyrighted, and I can’t imagine anything worse than being sued by Mary Poppins. If you want to be serenaded by Ms. Andrews singing “Favorite Things” as you read this, feel free to go download it, or perhaps better, the Coltrane version. I’ll wait…
1. Lots of My Favorite Enhanced Editor Tricks Still Work!
The good news in transitioning from the Enhanced Editor to the Enterprise Guide editor is that mostly things feel the same, and many of the same tricks still work.
Pete Lund has a great paper on how to use keyboard macros to make coding easier. In the Display Manager Enhanced Editor, I hit Ctrl-H to insert a program header, Ctrl-M to insert a macro header, and I have several more. All of my keyboard macros work in Enterprise Guide. To make them available, just import the keyboard macro file, as described in Pete’s paper. You access the keyboard macros via the Program menu:
Another tip I picked up a few years back is to set my log colors to make it easier to spot errors and warnings. I set both of these to be reversed (white letters or a red/green background). In Enterprise Guide, you access the dialog box to set these colors via Program->Editor Options. The dialog box looks familiar, it’s even still called “Enhanced Editor Options!”
My log then looks like:
So if you like the Enhanced Editor, you will be happy to know that you can do most of the same stuff using the Enterprise Guide editor. (The one thing I miss in Enterprise Guide is the ability to customize my Function Keys.). And of course, the Enterprise Guide editor can do more.
2. Code Tips!
If you’re a SAS programmer, you are probably used to writing code, not clicking your way through generating code. You have memorized the complete body of SAS syntax, and can write SAS code as fluently as you write English. Before Enterprise Guide, you’ve never had much in the way of coding help from your editor, why would you need it now?
Well, I almost never remember the order of the parameters to the TRANWRD function (this is why I use keyword parameters in my macros, I HATE positional parameters!) . So little tips like below are much appreciated:
And of course SAS is too big for anyone to know it all. Right now I’m learning the Graphics Template Language. As I work on a statement, I love that I can ask for a hint that will pop up all the options available for a statement:
Even little things like parentheses matching are surprisingly useful:
3. Reformat Code
I picked up this last tip from a recent thread on SAS-L. It’s a little thing, but there are lots of helpful little things in Enterprise Guide. The question came up of what to do when you receive a bunch of code that is hard to read, because its not indented, there are multiple statements on a single line, etc. And one response was, “use Enterprise Guide to fix it.” Huh? It turns out, that with one click (Ctrl-I or Edit-> Format Code), Enterprise Guide will reformat a messy block of code like this:
How cool is that?
Never miss a BI Notes post!
Click here for free subscription. Once you subscribe you'll be asked to confirm your subscription through your email account. You email address is kept private and you can unsubscribe anytime.