Building a Transcoding List

A transcoding list provides the information necessary for the HTML Formatting Tools to convert character data to the corresponding Unicode Numeric Character Reference (NCR). We provide several transcoding lists with the HTML Formatting Tools. Before you create your own list, look at those that are provided by SAS to be sure we have not already done the work for you.

Creating a Transcoding List

Use the MAKETL macro to create your custom transcoding list. The syntax for the macro is:

   %MAKETL (argument=value, argument=value, ...);

MAKETL Syntax

You can use the following arguments with the MAKETL macro.

tranlist=transcoding-list-name

The four-level name for the transcoding list that you are creating. This argument is required, and the 4th level of the name must be SLIST.

desc=description
A description for the transcoding list you are creating. The description is limited to 40 characters. If it contains more than 40 characters, the description is truncated. The description is displayed in the catalog directory window.

This argument is optional.

trantab=translate-table-name
The one-level name of the SAS TRANTAB entry that contains the information used to build the transcoding list. MAKETL looks for this TRANTAB entry in the SASUSER.PROFILE catalog. If the entry is not there, MAKETL then looks in the SASHELP.HOST catalog. If the entry does not exist, MAKETL writes an error message to the LOG window and the process is terminated.

Note: You must include either the DATA or the TRANTAB argument. These arguments are mutually exclusive.

data=SAS-data-set-name
The one- or two-level name of the SAS data set that contains the information used to build the transcoding list. If you use the DATA argument, you must also specify TO and FROM.

Example 5 shows how to create the necessary data set when there is not an appropriate transcoding list.

Note: You must include either the DATA or the TRANTAB argument. These arguments are mutually exclusive.

from=SAS-variable-name
The name of the SAS variable in the data set specified by DATA that contains the characters to be transcoded. This argument is required only if you specify DATA.

If FROM is a character variable, MAKETL assumes the value to be the 2-digit hexadecimal code for the desired character. If FROM is a numeric variable, MAKETL assumes the value to be the decimal code for the desired character. The valid hexadecimal range for FROM is 0x00-0xFF, and the valid decimal range is 0-255. Numeric values must be integers.

to=SAS-variable-name
The name of the SAS variable in the data set specified by DATA that contains the value to which the characters will be transcoded. This argument is required only if you specify DATA.

If TO is a character variable, MAKETL assumes the value to be the 2- or 4-digit hexadecimal code for the desired character. If TO is a numeric variable, MAKETL assumes the value to be the decimal code for the desired character.The valid hexadecimal range for TO is 0x0000-0xFFFF, and the valid decimal range is 0-65,535. Numeric values must be integers.

______________

For more information, see the following topics: