These are a Few of My Favorite Things… about the SAS Enterprise Guide Program Editor

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:

EGkeyboardMacro

 

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!”

EGLogColor

My log then looks like:

 Colored log

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:

Tranwrd

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:

ProcTemplate

Even little things like parentheses matching are surprisingly useful:

EGparens

 

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:

EGmessycode

into this:

EGcleancode

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.

4 thoughts on “These are a Few of My Favorite Things… about the SAS Enterprise Guide Program Editor

  1. Thanks for commenting Tom. I worked with a guy whose coding style I hated … this new feature would have prevented several arguments.

    I don’t always follow my own programming style but I get really upset when others don’t as well!
    😉

  2. I like to post on various online forums, but I’m terrible for just hacking out some code. My terrible coding style would be really embarassing except that once I have it working, a quick click to Edit | Format Code, and I look like less of a Visigoth. Thank you SAS!

    Tomm

  3. As you have mentioned, my favourite things are the autocomplete on SAS syntax and integrated syntax help. And with SAS Enterprise Guide 5.1 having autocompletion on data set and variable names is handy in avoiding typos.

    I also like the keyword tooltip options to link to the online support.sas.com documentation for additional information.

    Cheers,
    Michelle

Comments are closed.