Previous Page | Next Page

The SGDESIGN Procedure

Example 4: Use the DYNAMIC Statement to Specify a Column and a Character String


Procedure features: DYNAMIC statement

This example substitutes a column and also initializes the dynamic text for a title. The example assumes the following:

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;

Previous Page | Next Page | Top of Page