Have you ever selected File->Schedule Project or Schedule->Process Flow in SAS Enterprise Guide? Are you curious about what magic these actions will trigger?
Here's what happens:
- SAS Enterprise Guide creates a VBScript program that contains the instructions to start SAS Enterprise Guide, load your project, run your project or flow, and save the results.
- SAS Enterprise Guide launches the Windows Task Scheduler interface, so that you can specify when and how often to run your project/flow unattended.
- The scheduled task contains the command (CSCRIPT.EXE) and a reference to the VBScript (VBS file), which Windows will run at the appointed time. (Learn more about this mechanism at "Using SAS Enterprise Guide to run programs in batch".)
The VBScript instructions drive the SAS Enterprise Guide automation API, and that API is capable of much more than simply loading and running your project. And you aren't stuck with VBScript -- you can access the automation API using Windows PowerShell and Microsoft .NET.
As the following diagram shows, the automation interface is a peer to the main user interface for SAS Enterprise Guide. Like the happy gentleman pictured at the top of the diagram, most users will interact with the main windows of SAS Enterprise Guide. Users gain access to this user interface by using the primary executable (SEGuide.exe), often by way of a desktop shortcut icon. With automation,you forgo the SAS Enterprise Guide user interface entirely, and you instead script every action using the automation API.
These are the concepts and examples that are the subject of my SAS Global Forum 2012 paper, Not Just for Scheduling: Doing More with SAS Enterprise Guide Automation. I will present this topic at the conference on Wednesday morning at 8am (with coffee in hand, most likely).
Check out my summary page on SAS Support Communities for links to the paper, blog posts, and several examples. The examples include:
- A VBScript example that can extract all of the SAS programs and SAS logs from your project file.
- A PowerShell example to create a simple listing of all of the tasks and input data within your project file.
- A Microsoft .NET example (implemented with C#) that allows you to search for any text within your project file.
That last one is of special interest (and worthy of a separate blog post later). Even if the automation API isn't your thing, you might enjoy the EGPSearch example, which allows you to search a collection of SAS Enterprise Guide project files for any text within your SAS programs, logs, notes and more.