SGDESIGN Procedure

DYNAMIC Statement

Assigns values to dynamic variables that have been defined in the SGD file. You can either specify variables in multiple DYNAMIC statements or specify all of your variables in a single DYNAMIC statement.
See: Using the DYNAMIC Statement to Specify a Column and a Character String

Syntax

DYNAMIC dynamic-var–1="assigned-value–1" <dynamic-var–n="assigned-value-n">;

Required Argument

dynamic-var= assigned-value
specifies the values for one or more dynamic variables. For more information about dynamic variables, see Dynamic Variable Concepts.
dynamic-var
specifies the name of a dynamic variable.
The variable must be declared in a DYNAMIC statement within the SGD file's template. (In ODS Graphics Designer, you can see the dynamic variables that have been declared for a graph when you view the graph's template code from the View menu.)
assigned-value
specifies the value for the dynamic variable. If the value is a character string or a column name, then it must be enclosed in single or double quotation marks. For example: V1="year" and MYTITLE="Distribution of Patient Weight".
If the value is a numeric value, then you should supply a number. In this case, no quotation marks are required. For example: BINS=5.
When the value refers to a column name, then the new column must be the same type as the column that it replaces. For example, if V1 is a numeric type column, then the column name that you specify must also be numeric.
When the value is a column name, the case of the string value does not matter. For example, V1="Weight" is effectively the same as V1="WEIGHT". When the value resolves to text that appears in the graph (for example, titles and axis labels) the value entered is case-sensitive.

Details

When you use dynamic variables, be aware that some variables must be initialized, whereas for others, initialization is optional. For example, suppose that the graph file Histogram.sgd is defined with dynamic content in the title. In order to execute this SGD file with the correct title, the dynamic variable used in the title must be initialized. (In the example, the dynamic variable is named TITLE.)
proc sgdesign sgd = "Histogram.sgd";
  dynamic TITLE = "This is a Histogram";
run;
However, if the SGD file was created with a shared variable, then that shared variable has already been assigned a column value in the SGD file. You do not need to specify a value for the variable unless you want to change the column. For more information about shared variables, see Dynamic Variable Concepts.
If you have multiple dynamic variables, you can either specify variables in multiple DYNAMIC statements or specify all of your variables in a single DYNAMIC statement. For example, the following statement specifies two variables.
dynamic V1="cholesterol" EXAMPLESV="Cholesterol"; 
As an alternative, you can specify the dynamic variables in multiple DYNAMIC statements.
dynamic V1="cholesterol"; 
dynamic EXAMPLESV="Cholesterol";