SAS Talks: Favorite SAS Enterprise Guide Tricks

Last week's SAS Talks session, My Favorite SAS Enterprise Guide 5.1 Tricks, was remarkable in several ways.

First, the featured presenter was Marje Fecht, who also serves as the conference chair for SAS Global Forum 2014. She's an avid SAS professional who loves to educate her fellow SAS users on the best productivity tips and practices, including the use of SAS Enterprise Guide. As Marje points out, SAS Enterprise Guide is a primary topic of at least 20 presentations at the upcoming conference. You can see this for yourself in the easy-to-use conference scheduler, which allows you to slice-and-dice the agenda in many ways, including by SAS product.

The second remarkable thing about this SAS Talks session was the attendance. The number of connected participants was through the roof. It's a testament to Marje's star power and to the popularity of the topic. Did you miss it? The archive recording is available here and is free to view.

There was one more remarkable aspect to the session that I hope most attendees did not notice. On the day of the SAS Talks event, SAS headquarters was closed due to inclement weather in North Carolina. Aside from Marje (who was in sunny Florida), the session hosts and panelists were all snowbound in our respective homes. With an ice storm in the forecast, we hoped that our power and Internet connections would sustain us. And fortunately, they did.

I-Kong Fu, the product manager for SAS Enterprise Guide, followed Marje's presentation with a short demo of SAS Enterprise Guide 6.1 and a glimpse into some future developments for the next release of the product. While Marje and I-Kong were "on stage", my colleague Mark Allemang and I addressed many of the technical questions that participants submitted using the Q&A feature. In the remainder of this post, I've grouped the questions by topic and summarized the answers.

About the Data Explorer

Marje presented a thorough review of the interactive Data Explorer. According to Marje, the Data Explorer replaces a number of manual coding steps that analysts typically perform as they get acquainted with their data.

Q: Can I use the Data Explorer with WORK data sets?
A: The Data Explorer uses a special pool of utility SAS sessions (Workspaces) to perform its operations. Since these sessions can't share the WORK folder from your primary SAS session, the Explore option doesn't appear for WORK data. However, here's a trick... Submit this code within a SAS program node:

libname explorer &sasworklocation;

This will assign a new library (named "EXPLORER" in this case) to the same physical path as WORK, and you should be able to use the Data Explorer from that library.

Q: I don't see the Explore option on the menu, even for non-WORK data. Why not? Am I cursed?
A: Don't panic. Check whether you have the option "Automatically open data when added to project" disabled (in Tools->Options->Data General). If you disable that option, the Explore data feature becomes...hidden. See Problem Note 48487 for details.

Q: Can I use Data Explorer with DBMS tables in SAS/ACCESS libraries? Very large tables?
A: Yes, you can use this feature with any table in a library that you access with SAS. Behind the scenes, the Data Explorer runs PROC SQL and other descriptive-oriented SAS procedures to summarize data and produce "Quick Stats". Larger tables might take longer to generate results, but there isn't a hard limit on the size. You can configure the behavior of automatic Quick Stats to a maximum number of columns (default: 20) or data set rows (default: 10,000). See the SAS Enterprise Guide online help for more details.

When using a DBMS, your database administrator might have some opinions about how/when you should use this interactive exploration tool. A SAS administrator can limit this feature (using metadata roles/capabilities) if desired.

About the SAS Enterprise Guide projects and process flows

Marje showed how she was able to be more productive by organizing her work into projects, using process flows, built-in tasks, and notes. And I-Kong showed the new "sticky-note" style of process flow notes in the 6.1 version.

Q: When you create a Note in the process flow and then export a SAS program that you link to it, does the content appear as comments in the exported program?
A: No. The Note object isn't exported as part of the code, as it really annotates the process flow and not just the program. Using the Note object doesn't "excuse" you from adding useful comments in your code!

Q: In the SAS Enterprise Guide workspace, can you divide up your windows by monitor (if using multiple displays)?
A: No, not currently. Most of the SAS Enterprise Guide windows are constrained to the main application window, and cannot "float" to other monitors. This is something that the R&D team is exploring for a future release.

Q: When you select "Send to Excel" for a data set, is there a way to access the SAS program for that operation? Does it use SAS/ACCESS to PC Files?
A: The "Send To" mechanism does not actually use SAS code to do the work -- which is why you don't need the SAS/ACCESS product for this. Instead, SAS Enterprise Guide automates your local instance of Microsoft Excel and populates a new spreadsheet with the selected data set. This is just one of many ways to get your SAS content to Excel.

Q: Why doesn't the Query Builder task discover the table relationships from the database schema when adding two tables from the same database?
A: The relationships aren't always apparent from a SAS/ACCESS library. Right now, efficient queries do require some education on the part of the end user to know what keys/indexes to leverage. A database administrator can help users by defining SQL views that comprise the most commonly requested combinations.

About SAS programming

The program editor in SAS Enterprise Guide is syntax-aware, and provides keyword suggestions as well as automatic display of SAS library names, data set names, and even variable names as you type. It also provides a very handy code formatter that makes your programs (or those you "inherit" from colleagues) much more readable.

Q: Does the "autofill" work with the WHERE statement?
A: Yes (see picture). You can also call up a list of variables in the active data set with the Ctrl+Shift+V key combination. A full list of keyboard shortcuts is in the SAS Enterprise Guide online help (search the index for "keyboard shortcuts").

Q: Can I run just a selection of SAS code?
A: Yes. In the program editor, you can select the lines that you want to run, right-click and select Run Selection on (server) (or press F3 as a shortcut). Also, in a process flow you can select multiple program nodes (Ctrl+click), then right-click and select Run to run just those nodes. And don't forget about the File->New->Ordered List feature to create a list of program nodes to run in a prescribed sequence.

Q: Can I rely on all code being saved within a project?
A: You can decide: save the code in the project file (embedded) or store it on a file system as .SAS files. In the latter case, the SAS Enterprise Guide project holds a shortcut reference to the program file(s). And, you can mix and match -- with some embedded, some external files.

About SAS program versioning

I-Kong demonstrated some new features that are currently under development. One feature that generated much discussion was built-in "SAS program versioning", which keeps track of your SAS program revisions over time. I-Kong showed how you will be able to access the program history and compare differences over time. If this sounds interesting to you, take the time to watch the demonstration in the recorded SAS Talks session.

Q: Do I have to license WinMerge to see the SAS program differences?
A: No. WinMerge is free and that's what I-Kong showed, but you can use any file comparison/merge tool (for example, Beyond Compare or WinDiff).

Q: Is the program history linear or tree-structured?
A: In the history window you see it as a linear progression. However, you can go back to any "snapshot" in time and bring it back as the "current version" if you want to recover to a particular point. Under the covers, SAS Enterprise Guide is using a Git repository -- but no additional setup is needed on your part.

You'll hear more about this and other future developments at SAS Global Forum 2014, which now brings me to the final action item...

Don't stop learning: attend #SASGF14

Have you made your plans for SAS Global Forum? If not, it's the perfect time to take advantage of the Presidents Day Special. Through February 21, pay for one registration and you'll receive a discount code for 50 percent off of a second registration (both at the lower early-bird rates).