space
Previous Page | Next Page

SAS/CONNECT 9.2 Driver for Java

SAS/CONNECT Server Configuration and the textTransportFormat Property

The textTransportFormat property specifies the text transport format (that is, the encoding of character data exchanged between the SAS/CONNECT driver for Java and the SAS/CONNECT server). This page documents the way to specify the textTransportFormat property and configure the SAS/CONNECT server so that the driver and server agree on the text transport format.

Note: For SAS/CONNECT 8.2 and later servers, the textTransportFormat property is not used because the value of textTransportFormat is automatically determined when connecting to those releases of the SAS/CONNECT server.

By default, the SAS/CONNECT server assumes that the transport format for text should be ASCII. Typically, that default is useful only when:

If either of those conditions are not in effect, then configuring the SAS/CONNECT driver for Java and the SAS/CONNECT server is necessary.

The best strategy to use when you find that the default text transport format needs to be changed is to make the text transport format exactly the same as the native character encoding of the machine hosting the SAS/CONNECT server. This strategy prevents you from having to make character encoding conversions in the SAS/CONNECT server, and it allows you to take advantage of the rich set of character encoding converters that are included with most Java virtual machines. To implement this strategy, you must:

  1. Override the SAS/CONNECT server's default character encoding conversion mechanism so that it makes no conversion.

  2. Inform the SAS/CONNECT driver for Java of the server's native character encoding so that it can use the Java virtual machine's character encoding converters to make the proper conversion.

The SAS/CONNECT server's character encoding conversion mechanism is controlled by a set of tables that translate character codes from one encoding to another. These tables, called translation tables, can be created and modified using the TRANTAB procedure and can be installed using the system option TRANTAB. To make the text transport format the same as the native character encoding of the machine hosting the SAS/CONNECT server, you need to create a translation table that "translates" each character code to itself.

The following SAS program creates such a translation table and stores it in your SASUSER.PROFILE catalog. Your SAS system administrator can copy it to the SASHELP.HOST catalog to make it available to all SAS users at your site.

   proc trantab table = identity;
        replace "00"x "000102030405060708090A0B0C0D0E0F"x;
        replace "10"x "101112131415161718191A1B1C1D1E1F"x;
        replace "20"x "202122232425262728292A2B2C2D2E2F"x;
        replace "30"x "303132333435363738393A3B3C3D3E3F"x;
        replace "40"x "404142434445464748494A4B4C4D4E4F"x;
        replace "50"x "505152535455565758595A5B5C5D5E5F"x;
        replace "60"x "606162636465666768696A6B6C6D6E6F"x;
        replace "70"x "707172737475767778797A7B7C7D7E7F"x;
        replace "80"x "808182838485868788898A8B8C8D8E8F"x;
        replace "90"x "909192939495969798999A9B9C9D9E9F"x;
        replace "A0"x "A0A1A2A3A4A5A6A7A8A9AAABACADAEAF"x;
        replace "B0"x "B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF"x;
        replace "C0"x "C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF"x;
        replace "D0"x "D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF"x;
        replace "E0"x "E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF"x;
        replace "F0"x "F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF"x;
        inverse;
        save both;
   quit;

After you have created the appropriate translation table, you can use the TRANTAB system option to read the translation table out of SASUSER.PROFILE or SASHELP.HOST and install it into the SAS/CONNECT server's character encoding conversion mechanism. The system option TRANTAB controls the mechanism for converting both from transport format to the native encoding of the server and from the native encoding of the server to transport format. Use the identity translation table for both purposes.

You can use any of a variety of ways to specify system options to SAS software. The example later in this section shows how to use the TRANTAB system option on the command line for UNIX and PC hosts. Consult SAS system options documentation if you want to see other ways of using it.

To inform the SAS/CONNECT driver for Java of the server's native character encoding, you use the name of the encoding as the value of the textTransportFormat option. Some character encodings have more than one commonly used name, so you need to be sure to choose the name for each encoding that is recognized by a Java virtual machine. JavaSoft maintains a list of recognized encoding names on their Web site (java.sun.com).

Example

The following example shows the applet parameters for the ConnectApplet that you can use to connect to a SAS/CONNECT server running on a PC with the SAS spawner in the United States or Western Europe. The important changes to note are the use of the textTransportFormat property and the use of the TRANTAB system option in the SAS command, which is specified in the value of the response3 property.

   <param name=prompt1 value="Username:">
   <param name=response1 value="">
   <param name=prompt2 value="Password:">
   <param name=response2 value="">
   <param name=userNameResponse value="response1">
   <param name=passwordResponse value="response2">
   <param name=prompt3 value="Hello">
   <param name=response3 value="sas -trantab '(identity,identity)'">
   <param name=textTransportFormat value="Cp1252">

Previous Page | Next Page | Top of Page