Generating Output for Java


To develop a SAS/GRAPH program that generates output for the Graph Applet or Map Applet, follow these steps:

  1. Reset graphics options and specify a device driver.

     goptions reset=all;  goptions device=java; 
  2. To conserve resources, close the default ODS output destination.

     ods listing close; 
  3. Open an output file by specifying an ODS statement and a fully qualified path . Use the STYLE= option to specify an ODS style (see Using ODS Styles on page 488). Use the PARAMETERS= option to configure the applet (see Specifying Parameters and Attributes for Java and ActiveX on page 421). Use other ODS options to enhance the HTML (see Overview of ODS Enhancements for Web Output on page 487).

     ods html     file="/dept/web-server1/sales/q393/eastregion.html"     style=gears     parameters=("tips"="none")     headtext="Georgia Peaches, Inc."     nogtitle; 

    To run an applet, your audience must be able access the appropriate Java archive files. Two archives are referenced by default: one is the Java plug-in from Sun Microsystems, and the other is the SAS Java archive.

    In the ODS output file, the location of the Java plug-in from Sun Microsystems is specified in the CODEBASE attribute of the OBJECT tag. If you need to change this default value, then use the ATTRIBUTES= option of the ODS statement, as described in Specifying Parameters and Attributes for Java and ActiveX on page 421. On Windows systems, the user is prompted to install the plug-in if it is not already installed. On other systems, the plug-in can be installed from the Sun Microsystems site (http://www.sun.com) or from one of the SAS Third Party Software Components CDs.

    The location of the SAS Java archive is specified in the CODEBASE parameter in the body of the APPLET tag. The default CODEBASE is specified by the APPLETLOC= system option. If the default value of this system option specifies a widely-accessible URL, then you need not change this value. If you need to specify a different location, then you can change the value of the system option. Another alternative is to override the APPLETLOC= system option by specifying a value for the ODS statement option CODEBASE=, as described in Specifying Parameters and Attributes for Java and ActiveX on page 421.

    Note: When specifying a location for the SAS Java archive, you can use an HTTP address, or you can use a UNC path, such as //sasjava, with forward slashes instead of backward slashes .

  4. Provide data using a LIBNAME statement or a DATA step.

     data regsales;      length Region State $ 8;      format Sales dollar8.;      input Region State Sales;      datalines;  West CA 13636  West OR 18988  West WA 14523  Central IL 18038  Central IN 13611  Central OH 11084  Central MI 19660  South FL 14541  South GA 19022  ; 
  5. Generate your initial graphics output.

     title1 'Regional Sales';  proc gchart data=regsales;     vbar3d state / sumvar=sales  run;  quit; 

    The procedure does not require any additional statements to generate output that runs in an applet.

  6. Close the HTML output file and reopen the ODS listing destination.

     ods html close;  ods listing; 

Running your program starts the applet and displays the initial graph.

If the browser display differs from what you would see in SAS without ODS, then ensure that your SAS/GRAPH procedure is fully enabled in the applet. Refer to Appendix 1, Summary of ActiveX and Java Support, on page 1507 for details.

Note: Using PROC GMAP to generate a highly detailed map might create a large HTML output file, which might cause problems on certain browsers. If this is the case, you can run PROC GREDUCE to remove some of the complexity and produce a more usable map.

For further information on troubleshooting Web output, see Troubleshooting Web Output on page 579.

About Languages and Special Fonts in Java

For international audiences, the Java applets have graphical user interfaces that can appear in the following languages: Chinese (simplified), Czech, Danish, English, French, German, Hebrew, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Russian, Spanish, and Swedish. To display a translated graphical user interface, in general, Web-based Java device drivers must use a language-specific operating environment and Web browser. This requires the all-langauges version of the JRE. For further information, contact your SAS support consultant.

In the LABEL and SYMBOL statements, the Java applets enable the following markers: B, C (up triangle), M (club), N (heart), O (spade), P (diamond), U (square), and V (star). For a full list of the marker font that applies to these letters , see Figure 5.5 on page 87. Also enabled are the following symbols: D (diamond), H (circle), L (up triangle). For a full list of the special font, see Figure 5.8 on page 89.




SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net