Working with the Graph Code

For each graph that you create, the designer provides the code that is used to generate the graph. The code contains the graph template and the SGRENDER procedure that renders the graph.

View, Copy, and Save the Code for a Graph

You can view the SAS code for any of your graphs. You can also copy and paste part or all of the code into a SAS program, and you can save the code as a SAS file.
  1. To view the code, select the graph to make it active, and then select Viewthen selectCode. A window appears and displays the code for the graph.
  2. To copy the code, select the portion of the code that you want, and then select Editthen selectCopy.
    Tip
    To select the entire code, select Editthen selectSelect All.
    You can now paste the code into SAS or into a text editing application.
  3. To save the code as a SAS program, select Filethen selectSave As. Then specify the location and filename for the code.
  4. Select Viewthen selectCode again to close the code window, or click the Close button Close button in the window.

Change the Name of the Graph Template

The default name for the graph template is SGDESIGN when the graph is created from the Graph Gallery. The default name for new blank graph is GRAPH1, GRAPH2, and so on.
There are two ways to change the template name:
  • change the name when you save the graph using the Save As function.
  • change the name in the Graph Properties dialog box. To access this dialog box, right-click the graph and select Graph Properties.
The name must start with a letter or underscore. Subsequent characters can be letters, underscores, or numeric digits.