Examples Using Compute Services |
Purpose |
If the SAS/GRAPH software is installed on the client and server computers, you can submit graphics programs from your client session to a server session, execute the procedure in the server session, and display the graphics output in the client session (or on a device that is attached to your client computer). This link is especially useful when you want to generate graphics in your client session by using a large database that is accessible from the server session.
The GRLINK driver is a special driver that is available with SAS/CONNECT. You must always use the GRLINK driver in the server session when using the link to display server machine graphics in your client session.
If you frequently use the link for server graphics processing, consider specifying the GRLINK device driver in a script file (if you use a script file with the SIGNON command). To do this, include the driver specification for the server computer in the TYPE statement that invokes the server session.
In this program, if you use TSO via TCP/IP, change the TYPE statement in the script file to the following code:
type "sas options('comamid=tcp device=grlink dmr')";
By changing the TYPE statement in the script file each time that you use the SIGNON command, you automatically specify the GRLINK driver in the server session. The GRLINK driver is specified in the sample scripts that are provided with your SAS software.
This program uses the RSUBMIT statement to submit SAS statements, which include any LIBNAME statements that are needed in the server session. When the SAS/GRAPH procedure runs in the server session, the output is displayed at the client session or on an attached device (based on the driver that you specified in your client session). Be sure to specify the GOPTIONS DEVICE=GRLINK driver as shown in step 3.
Program |
1 goptions device=''; 2 rsubmit; proc sort data=master.bg_reserve out=tmp; by origin rental_type; run; proc summary data=tmp vardef=n noprint; by origin rental_type; output out=temp_rental; run; 3 goptions device=grlink ftitle=centx ftext=simplex htitle=2; title 'Rental Types by Franchise'; pattern value=solid color=blue; axis1 label=('Franchise') order= ('ATLANTA' 'CHICAGO' 'LOS ANGELES' 'NEW YORK' 'TORONTO') width=3; axis2 label=none width=3; axis3 label=none order=0 to 1000 by 100 width=3; proc gchart data=temp_rental; label rental_type='00'x; label origin='00'x; hbar rental_type / frame sumvar= _freq_ maxis=axis2 raxis=axis3 minor=0 nostats group=origin gaxis=axis1 discrete; run; quit; endrsubmit;
When using the link to display server session graphs, you can use any graphics procedure on the server (including the GREPLAY procedure) and any graphics device driver on the client.
The GRLINK server computer driver uses the attributes of the driver that is specified in the client session when selecting default colors, character sizes, and other attributes. For example, if you specify DEVICE=PSCOLOR in your client session, the GRLINK driver uses the default colors of the PSCOLOR driver, but if you specify the printer driver DEVICE=PCL5 in your client session, the GRLINK driver uses only black as a foreground color.
Note these reminders when using the link for graphics:
Do not specify GOPTIONS NODISPLAY in the program that you submit to the server session. If the GRLINK driver is on the server computer, the option is not supported.
Do not specify DEVICE=GRLINK in your client session. The GRLINK driver can be specified only on the server. In your client session, you can specify a device driver that is available with SAS/GRAPH only on that machine.
You can use hardware options, such as NOCHARACTERS, only on the client. You cannot use hardware options that are not available with your client computer hardware configuration, even though the options are supported on the server computer.
To use the CBACK= or the ROTATE= option, you must specify it in your client session program, not in the program that you are submitting to the server session. If you use the CBACK= or the ROTATE= option in the program that is submitted to the server session, the option is accepted but has no effect.
To use the GREPLAY procedure through the link, you must use the NOFS option in the PROC GREPLAY statement.
Each time you generate graphics output in the client session, it is stored temporarily, while running the same SAS session, in a catalog called GSEG in the WORK library of the client session. Later, displays of the same graphics output can be generated from this catalog. To retain a copy of this catalog after your current session ends, copy it to a permanent location.
You can also transfer catalog entries that contain graphics output by using the UPLOAD and DOWNLOAD procedures, as described in Example 3.4: Using the ENTRYTYPE= Option in Two SELECT Statements in PROC DOWNLOAD.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.