Generating Output for Java

About Generating Output for the Graph and Map Applets

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 the JAVA device:
    goptions reset=all device=java;
  2. Close the current ODS HTML destination:
    ods html close;
  3. Open the ODS HTML destination. You can use the BODY= option to specify an HTML filename, and the STYLE= option to specify an ODS style (see Using ODS Styles, Device Parameters, and Options). Use the PARAMETERS= option to configure the applet (see Specifying Parameters and Attributes for Java and ActiveX). For example:
    ods html
       file="your_file.htm"
       style=statistical
       parameters=("tips"="none");
    Note: To run an applet, your users 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 HTML 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 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 Web site (http://www.sun.com) or from the SAS Third-Party Software References Web page:
    http://support.sas.com/resources/thirdpartysupport/index.html
    The location of the SAS Java archive is specified in the JAVA_CODEBASE and the ARCHIVE parameters in the body of the APPLET tag. The default JAVA_CODEBASE is specified by the APPLETLOC= system option. If the default value of this system option specifies a widely accessible URL, then you do not need to 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.
    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. Run a procedure or procedures that are used by the JAVA device (see Procedures and Statements That Generate Output for the SAS/GRAPH ActiveX Control):
    proc gchart data=sashelp.class;
       vbar sex / type=mean sumvar=height group=age subgroup=sex space=0;
    run;
    quit;
  5. Close ODS HTML to close the output file, and then reopen ODS HTML:
    ods html close;
    ods html;
Running your program starts the applet and displays the initial graph. If a large amount of data is used to generate the graph, the Java Virtual Machine (JVM) default heap size might not be sufficient to generate the graph. In that case, the chart fails to display in your Web browser, and the following error appears in the Java Console:
java.lang.OutOfMemoryError: Java heap space
To correct the problem, include the PARAMETERS= option in your ODS HTML statement to increase the heap size as described in Specifying the Java Virtual Machine Maximum Heap Size.
If the browser display differs from what you see in SAS, then ensure that your SAS/GRAPH procedure is fully enabled in the applet. Refer to Summary of ActiveX and Java Support for details.
Note: Using the GMAP procedure 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 the GREDUCE procedure to remove some of the complexity and produce a more usable map.
For further information about troubleshooting Web output, see Resolving Differences between Graphs Generated with Different Technologies.

About the Java HTML Output and the Java Runtime Environment Plug-In

The Java Runtime Environment (JRE) plug-in is required to open HTML output that is generated by the JAVA device. If you open an HTML file that you generated using the JAVA device and you do not have the JRE plug-in installed for your Web browser, the browser prompts you to install the JRE plug-in. You must install the JRE plug-in for your browser in this case. When your users open your HTML file, they will also have to install the JRE plug-in for their Web browser if the plug-in is not already installed on their computer.
The 9.2 SAS/GRAPH Java applets will work with JRE 1.5.0_12. They have also been tested with 1.5.0_13 and 1.5.0_15. We recommended that you use one of these versions. If future JREs are backward compatible, then the applets should work without any issues.

About Languages 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. Generally, to display a translated graphical user interface, Web-based JAVA devices must use a language-specific operating environment and Web browser. This requires the all-languages version of the JRE. For further information, contact your on-site SAS support personnel.

About Special Fonts and Symbols in JAVA

The Java devices support only system fonts. The following figure shows the special symbols that the Java devices support and the value that you must specify in the SYMBOL statement VALUE= option for each.
Special symbols that are supported by the Java devices
See SYMBOL Statement for more information.

SAS Formats Supported for Java

The JAVA devices support the SAS character, numeric, and the date and time formats that are listed in the following tables. For a description of these formats, seeSAS System Options: Reference.
Character Formats Supported By Java
$
$ASCII
$BINARY
$CHA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WORDDATE
WORDDATX
YEAR
YYMM
YYMMDD
YYMMDDN
YYMMN
YYMON
YYQ
YYQN
YYQR
YYQRN
YYWEEKU
YYWEEKV
YYWEEKW
Note: The JAVA and JAVAIMG devices do not support nested formats that include user-defined formats. If you want to use a custom format with these devices and the custom format nests other formats, make sure that it nests only the formats that are provided by SAS.
Note: The JAVA and JAVAIMG devices do not support dates that are formatted using the DATATYPE=DATE option in the FORMAT procedure PICTURE statement.