Sample 43863: Creating a SAS® Stored Process that generate multiple spreadsheets in Microsoft Excel when opened using the SAS® Add-In for Microsoft Office
Overview
This sample provides a way to direct stored process output to more than one worksheet.
The key to achieving this goal is to use the SAS procedure PROC PRINT with several
grouping options.
About the sample stored process
As the input table for the stored process, this sample uses SASHELP.SHOES. If you want to follow along with the sample, copy and save the code shown below. For this example, the stored process is named shoes.sas. Make note of the physical location. You will need it later when you register the stored process in metadata.
*Processbody;
%stpbegin;
proc print data = sashelp.shoes;
pageby region;
by region;
run;
%stpend;
|
Register the stored process
In SAS Management Console, click the Folders tab. Select SAS Folders ► Shared Data ► StoredProcesses. Right-click on StoredProcesses and select New Stored Process to launch the New Stored Process wizard. Complete the wizard to register the stored process. For assistance at any step, click Help on the wizard page.
Opening the stored process in Microsoft Excel
- Open Microsoft Excel.
- On the SAS tab, select Tools ► Options.
- On the Results tab, select the option Place grouped analyses on new worksheets.
- Click OK.
- On the SAS tab, click Report in the Insert group, and select the stored process that you saved previously. You should see results similar to the following, showing that multiple worksheets were created.

Additional Documentation
For more information about using the SAS Add-In for Microsoft Office, see the SAS Add-In for Microsoft Office documentation page.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample provides a way to direct stored process output to more than one worksheet. The key to achieving this goal is to use the SAS procedure PROC PRINT with several grouping options.
| Date Modified: | 2011-09-21 11:02:04 |
| Date Created: | 2011-07-29 14:33:56 |
Operating System and Release Information
| SAS System | SAS Add-in for Microsoft Office | Microsoft® Windows® for x64 | 4.3 | | 9.2 TS2M3 | |
| Microsoft Windows Server 2003 Datacenter Edition | 4.3 | | 9.2 TS2M3 | |
| Microsoft Windows Server 2003 Enterprise Edition | 4.3 | | 9.2 TS2M3 | |
| Microsoft Windows Server 2003 Standard Edition | 4.3 | | 9.2 TS2M3 | |
| Microsoft Windows Server 2003 for x64 | 4.3 | | 9.2 TS2M3 | |
| Microsoft Windows Server 2008 | 4.3 | | 9.2 TS2M3 | |
| Microsoft Windows Server 2008 for x64 | 4.3 | | 9.2 TS2M3 | |
| Microsoft Windows XP Professional | 4.3 | | 9.2 TS2M3 | |
| Windows 7 Enterprise 32 bit | 4.3 | | 9.2 TS2M3 | |
| Windows 7 Enterprise x64 | 4.3 | | 9.2 TS2M3 | |
| Windows 7 Home Premium 32 bit | 4.3 | | 9.2 TS2M3 | |
| Windows 7 Home Premium x64 | 4.3 | | 9.2 TS2M3 | |
| Windows 7 Professional 32 bit | 4.3 | | 9.2 TS2M3 | |
| Windows 7 Professional x64 | 4.3 | | 9.2 TS2M3 | |
| Windows 7 Ultimate 32 bit | 4.3 | | 9.2 TS2M3 | |
| Windows 7 Ultimate x64 | 4.3 | | 9.2 TS2M3 | |
| Windows Vista | 4.3 | | 9.2 TS2M3 | |
| Windows Vista for x64 | 4.3 | | 9.2 TS2M3 | |