Introducing: Custom Tasks for SAS Enterprise Guide using Microsoft .NET
by Chris Hemedinger
This book takes you step-by-step through the process of creating custom tasks for use in SAS Enterprise Guide and SAS Add-In for Microsoft Office. You'll learn how you can hook in your custom processes and make them available to a wide range of SAS users.
|
Reference documentation (packaged as help files in ZIP archives) |
For SAS Enterprise Guide 3.0 | For SAS Enterprise Guide 4.1 |
Example custom tasks (binary files only) (.NET assemblies, or DLLs, ready to use) |
For SAS Enterprise Guide 3.0 | For SAS Enterprise Guide 4.1 |
Example custom tasks with source code (Visual Studio projects in ZIP archives) |
For SAS Enterprise Guide 3.0 (7 tasks) |
|
Visual Studio .NET 2003 template files for creating add-in tasks (Template files in a ZIP archive with deployment script and instructions) |
For SAS Enterprise Guide 3.0 | For SAS Enterprise Guide 4.1 |
SAS Sudoku Solver task, as seen at SAS Global Forum 2007. |
||
Looking for information about custom tasks with SAS Enterprise Guide 2.0? |
SAS Enterprise Guide provides you with easy access to powerful SAS analytics and data. Now you can extend SAS Enterprise Guide to take advantage of its connectivity and services, and use it
to create a custom solution that fits the needs of your organization or industry. One way to extend SAS Enterprise Guide is by creating a custom add-in task. A custom task allows you to add
custom functionality that goes beyond what is delivered in the core product. Here are some examples where this can be useful:
Another key advantage of creating custom tasks -- you can use these same tasks within the SAS Add-In for Microsoft Office.
This documentation describes how to create tasks for SAS Enterprise Guide 4.1 and the SAS Add-in for Microsoft Office 2.1. SAS Enterprise Guide has been extendable using add-ins since release 2.0. Although previous add-ins used a different technology, add-ins that you created for SAS Enterprise Guide 2.0 will work in SAS Enterprise Guide 3.0 and SAS Enterprise Guide 4.1, but not in version 4.2 or later. This table summarizes the supported configurations for tasks from previous versions:
This custom task API implementation | will work in these product versions |
COM API (Visual Basic 6.0) provided with SAS Enterprise Guide 2.0 | SAS Enterprise Guide 2.0, 3.0, and 4.1 (see note below) |
.NET API (Visual Basic .NET or C#) provided with SAS Enterprise Guide 3.0 | SAS Enterprise Guide 3.0 and 4.1 SAS Add-In for Microsoft Office 1.3 |
.NET API (Visual Basic .NET or C#) provided with SAS Enterprise Guide 4.1 | SAS Enterprise Guide 4.1, 4.2, 4.3, and 5.1 SAS Add-In for Microsoft Office 2.1, 4.2, 4.3, and 5.1 |
.NET API (Visual Basic .NET or C#) provided with SAS Enterprise Guide 4.2 | SAS Enterprise Guide 4.2, 4.3, and 5.1 SAS Add-In for Microsoft Office 4.2, 4.3, and 5.1 |
.NET API (Visual Basic .NET or C#) provided with SAS Enterprise Guide 4.3 | SAS Enterprise Guide 4.3 and 5.1 SAS Add-In for Microsoft Office 4.3 and 5.1 |
.NET API (Visual Basic .NET or C#) provided with SAS Enterprise Guide 5.1 | SAS Enterprise Guide 5.1 SAS Add-In for Microsoft Office 5.1 |
Best Practice: Where possible, use the most recent version of the .NET API for the product release you intend to target. For example, if you plan to create custom tasks for SAS Enterprise Guide 4.1, use the version 4.1 APIs in your implementation. The most recent APIs offer the most features and best support going forward. While the COM API (usually implemented with Visual Basic 6.0) is still supported through release 4.1, it will not be supported in future releases of SAS Enterprise Guide.
Using SAS Controls Supplied with SAS Enterprise Guide 2.0: If you have an existing COM-based custom task that makes use of the user-interface controls that shipped with SAS Enterprise Guide 2.0, you will need to install those controls to use your task on a system that does not have SAS Enterprise Guide 2.0 installed. The controls are supplied in this zip archive file:
You can extract the controls (all ActiveX controls with a .OCX file extension) and copy them to a new folder that you create on the target machine. Then you must register the controls with Windows so that they are available for use by your custom tasks. The zip archive contains a sample batch file that will register the control files using regsvr32.exe.
All examples supplied were created using Microsoft Visual Studio .NET 2003. Note: All examples are provided for illustration purposes only, and are not necessarily production-quality add-ins that are supported by SAS.
Example | Features |
Classic Hat Simple example of an add-in that creates the cowboy hat graph.
Screenshot of user interface Implemented in: Visual Basic .NET and C# |
|
Data Set Contents Creates a PROC CONTENTS report for the selected input data.
Screenshot of user interface Implemented in: C# |
|
Characterize Data (C#) Creates a report on data or a library that you select, detailing the contents and characteristics of the data columns within the selected members. Implemented in: C# |
|
Life Expectancy Uses a 3rd party web service to create a life expectancy table, and adds that data to the project.
Screenshot of user interface Implemented in: C# |
|
System Command Allows you to supply a series of Windows system commands to run within your project. Implemented in: C# |
|
SAS Catalog Explorer Launches a mini-application that allows you to view the contents of SAS catalogs on any server you select. You can even view the contents of certain types of entries, and delete entries. Implemented in: C# |
|
SAS Products Checker Analyzes the SAS server to determine which SAS products are licensed and installed. Implemented in: Visual Basic .NET and C# |
|
Compare Columns Compares two columns in a data set using PROC COMPARE. Screenshot of user interface Implemented in: Visual Basic .NET |
|
Compute Lag and Dif Applies the LAG or DIF function a selected variable to calculate a new variable in the output data. Implemented in: C# |
|
Create Picture Format Create a SAS picture format Implemented in: Visual Basic .NET |
|
Area Bar Chart Creates a bar chart where the width of the bar represents a sum or percentage of the total values. Screenshot of user interface Implemented in: C# |
|
Edit Individual Observations Provides an interface reminiscent of FSEDIT to view/change/insert a single record at a time. Implemented in: C# |
|
Atlantic Hurricane Tracker Uses web-based hurricane data to create tracking maps for Atlantic hurricanes from the past several years. Screenshot of user interface Implemented in: C# |
|
Loan Comparison Collects loan parameters and computes payments and interest, comparing results from different loans by using PROC LOAN and pie charts. Screenshot of user interface Implemented in: C# |
|
Merge Data Sets Merge data sets into a single data set, offering a variety of merge methods as illustrated in the samples area. Screenshot of user interface Implemented in: Visual Basic .NET and C# |
|
Paired-Bar Chart Creates a bar chart that compares two columns with a single vertical access in the center. Implemented in: C# |
|
Simple SAS Program Editor A simple window with the SAS enhanced editor for creating/running SAS programs. Implemented in: C# |
|
Import SPSS Data Files Uses SAS capabilities to read SPSS .por files and create SAS data views from them. Implemented in: C# |
|
Zip Code Dot Map Using response information and associated zip codes, creates a map of the United States and place dots over each zip code that indicate the relative amount of whatever is being measured. Screenshot of user interface Implemented in: C# |
|