SAS Institute. The Power to Know

Run a SAS stored process

A stored process is a SAS program that is saved on a server and can be executed as required by a requesting application. After saving a SAS program, you can invoke it from ArcMap using a VBA (Visual Basic for Applications) macro that you define in and run from ArcMap.

To access a SAS stored process from ArcMap:

Define a SAS program:
  1. Select File New Program from the SAS menubar.
  2. Write your program. You can encapsulate any SAS data step or macro code in a stored process.
  3. Save the program. By default, the file extension is .sas. If you use this default extension, then you do not need to specify it in your ArcMap VBA macro.
Define a VBA macro in ArcMap:
  1. Select Tools Macros Visual Basic Editor from the ArcMap menubar.
  2. Select Tools References from the menubar of the Visual Basic Editor.
  3. Select the following from the References window:
    • SAS Bridge for ESRI 2.0 Type Library
    • SAS: Integrated Object Model (IOM) (SAS System 9.1) Type Library
    • SAS WorkspaceManager 1.1 Type Library
  4. Select Insert Module from the menubar of the Visual Basic Editor.
  5. Type the macro code. See Sample VBA macro to run a stored process for a sample macro that prints a SAS data set as an HTML file.
Run the macro:
  1. Select Tools Macros from the Visual Basic Editor menubar (or, Tools Macros Macros from the ArcMap menubar).
  2. Select the macro you want to run.
  3. Click Run.

For additional information on SAS stored processes, refer to Demos and Downloads or SAS Integration Technologies Library.