Database Reference
In-Depth Information
Figure 11.6.10: The Excel Output of the DDE Macros.
Yes, this looks like it is more trouble than it is worth! But the five macros used here and described in
Section 11.4 are just building blocks. They can be used independently, or they can be combined to form a
more comprehensive tool that allows the work to be abstracted to the level of “start here and do the work”.
The next example will demonstrate what I mean by reducing all of this work into a single macro call.
Example 11.6.5 Writing a SAS Dataset to an Excel File Using the
SAS_2_EXCEL DDE Macro
This example will once again use the Sashelp.shoes dataset; however, it will be processed by using PROC
MEANS to create an output file with a summary of some of the variables found in the original file. Since
for this example we are also assuming that you need a formatted report for periodic delivery to other users,
we will also create an output format template that the data will be inserted into for the report. Below is a
sample report layout. (Column E is for showing the row number on the right side of the report.) The final
macro (SAS_2_EXCEL) in the DDE macro set described in Section 11.4 does not hard code any values.
All values used by the macro are either derived by the macro or sent to it by you. The output data spaces
start at Row 6 and Column 1. Figure 11.6.11 is the Excel template file. It is simply an Excel workbook with
a predefined format and space for the new data to be placed. This Excel workbook template is provided as
Shoe_Summary_Template.xlsx.
 
Search WWH ::




Custom Search