GRAPH functions perform library management tasks from within the DATA Step Graphics Interface. These functions can only be performed on one catalog at a time. They cannot be performed across catalogs. For example, you cannot copy a graph from one catalog to another.
When using GRAPH functions, remember the following:
All arguments are specified as variables or constants. If you express an argument as a variable, the variable must be initialized .
All character arguments expressed as character strings must be enclosed in quotes.
All character variable names used as arguments must be declared in a LENGTH statement.
All character constants must be enclosed in single or double quotes.
GRAPH functions:
CLEAR
COPY
DELETE
INSERT
PLAY
RENAME
UPDATE
Opens a graphics segment for output
Operating States: WSAC
Return Codes: 0, 3, 301, 302
Resulting Operating State: SGOP
return-code-variable =GRAPH( CLEAR <, name > <, des ><, byline >);
The GRAPH( CLEAR , ) function opens a graphics segment for output in the current catalog. The first parameter, CLEAR , is the only required one. The values of name , des , and byline are displayed in catalog listings and in catalog information in the GREPLAY procedure.
If the name specified is an existing graph, DSGI will suffix the name with a number. For example, if PIE is chosen for the name and it already exists, DSGI will name the output PIE1; the next time the code is submitted, DSGI names the output PIE2, and so forth.
This function moves the operating state from WSAC to SGOP.
name | character string enclosed in quotes or character variable name; gives a name to the graph to be opened. If name is not specified, DSGI assigns the graph a name that is some form of DSGI: for example, DSGI, DSGI1, and DSGI2. |
des | character string enclosed in quotes or character variable name; gives a description to the graph to be opened. If des is not specified, DSGI assigns the following description to the catalog entry: Graph from DATA Step Graphics Interface. |
by-line | character string enclosed in quotes or character variable name; gives another line of description for the graph. The byline appears under the titles on the graph. DSGI does not provide a default byline. |
OPENGRAPH on page 1428
UPDATE on page 1461
Copies a graph
Operating States: GKOP, WSOP, WSAC, SGOP
Return Codes: 0, 8, 307
return-code-variable =GRAPH( COPY , name, new-name) ;
The GRAPH( COPY , ) function copies a graph to another catalog entry. The graph to be copied must be closed and be in the current catalog. You cannot copy from one catalog to another. The new graph will also be in the current catalog.
name | character string enclosed in quotes or character variable name; name of the graph to be copied. |
new-name | character string enclosed in quotes or character variable name; name of the graph to be created. |
CATALOG on page 1407
DELETE on page 1459
INSERT on page 1459
CATALOG on page 1465
Deletes a graph
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 4, 8, 307
return-code-variable = GRAPH( DELETE , name );
The GRAPH( DELETE , ) function deletes a graph in the current catalog. The graph does not have to be closed to be deleted.
name | character string enclosed in quotes or character variable name; the name of the graph to delete. |
CATALOG on page 1407
COPY on page 1458
CATALOG on page 1465
Inserts a previously created segment into the currently open graph
Operating States: SGOP
Return Codes: 0, 4, 302, 307
return-code-variable =GRAPH( INSERT , name );
The GRAPH( INSERT , ) function inserts a graph into the currently open graph. The graph to be inserted must be closed and be in the current catalog.
name | character string enclosed in quotes or character variable name; the name of a graph to be inserted. |
CATALOG on page 1407
COPY on page 1458
CATALOG on page 1465
Displays the specfied graph on your output
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 307
return-code-variable =GRAPH( PLAY , graph-name );
The GRAPH( PLAY , ) function displays the specified graph on your output.
graph-name | character variable name; the name of the graph you would like to play. |
UPDATE on page 1461
Renames a graph
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 307
return-code-variable = GRAPH( RENAME , name, new-name );
The GRAPH( RENAME , ) function renames a graph. The graph to be renamed must be in the current catalog and be closed.
name | character string enclosed in quotes or character variable name; the name of the closed graph that is to be changed. |
new-name | character string enclosed in quotes or character variable name; the new name for the graph. |
CATALOG on page 1407
INSERT on page 1459
CATALOG on page 1465
Completes the currently open graph and ( optionally ) displays it
Operating States: SGOP
Return Codes: 0, 4
Resulting Operating State: WSAC
return-code-variable = GRAPH( UPDATE <, show >);
The GRAPH( UPDATE , ) function closes the graph currently open and displays it. DSGI operates in buffered mode, so the picture is never displayed until this function is called.
This function can be called only once for the currently open graph. Therefore, you cannot incrementally build a graph; however, you can close the currently open graph and later insert it into another graph within the same DATA step.
This function moves the operating state from SGOP to WSAC.
show | character string, optional; valid values are SHOW and NOSHOW. If SHOW is specified, the graph is displayed. If NOSHOW is specified, the graph is closed and not displayed. |
CLEAR on page 1457