Adding Dynamic Content to Text

About Dynamic Content

You can insert dynamic content into textual elements such as titles and footnotes. The dynamic content is substituted when you run the graph using the SGDESIGN procedure.
You can specify dynamic content in the following textual elements:
  • titles
  • footnotes
  • text entries
  • cell headers
  • axis labels

Specify Dynamic Content

Here is the form you use to specify dynamic content:
dyn(DNAME)
where DNAME is a name that you want to associate with the text that is generated.
Note: DNAME follows SAS naming conventions. The name cannot contain any special character other than “_”. In addition, DNAME must start with an alphabetic character.
After you have saved the graph, you can generate the graph using the SGDESIGN procedure. In the SGDESIGN procedure, you specify the value for DNAME with a DYNAMIC statement. When you generate the graph, the SGDESIGN procedure substitutes dyn(DNAME) with the value that you specified for DNAME.
For example, suppose that you want the title of a graph to vary by year. In ODS Graphics Designer, you might specify the following title: “Revenues for dyn(YEAR).”
When you run the graph using the SGDESIGN procedure, you can specify DYNAMIC year=”2009”. The entire string “dyn(YEAR)” is replaced with the specified value. In the resulting graph, the title becomes “Revenues for 2009”.