The SGDESIGN Procedure |
Procedure features: | DYNAMIC statement |
This example substitutes a column and also initializes the dynamic text for a title. The example assumes the following:
the existence of a shared-variable graph named SVDistribution.sgd that was created based on the SASHELP.CARS data set
in the SGD file, the shared variable V1 is set to HORSEPOWER
in ODS Graphics Designer, the title of the graph is Distribution of dyn(DDISTRIBUTE)
First, create the graph using the default data.
proc sgdesign sgd="SVDistribution.sgd"; dynamic DDISTRIBUTE="MPG City"; run;
Though this example uses the default value for the shared variable, there is no default value for the dyn(DDISTRIBUTE) function that is used in the title. To execute this SGD file with a correct title, the dynamic expression used in the title must be initialized, as shown in the previous code.
In the output, the title becomes Distribution of MPG City. The "Distribution of" portion of the title was defined in the SGD file. The "MPG City" portion was generated by using the DYNAMIC option.
You can create the graph using a different data set and substitute a different column for V1. You can also change the dynamic variable that is used in the title.
proc sgdesign sgd="SVDistribution.sgd" data=sashelp.heart; dynamic V1="cholesterol" DDISTRIBUTE="Cholesterol"; run;
In the example, the second instance of the SGDESIGN procedure uses a different data set that has different variables. Both MPG_City and Cholesterol are numeric variables. In the output, the title is Distribution of Cholesterol.
You can instead specify the dynamic variables in multiple DYNAMIC statements. The following code produces the same output as the previous code.
proc sgdesign sgd="SVDistribution.sgd" data=sashelp.heart; dynamic V1="cholesterol"; dynamic DDISTRIBUTE="Cholesterol"; run;
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.