TRANTAB Statement

Specifies the translation table to use when you transcode character data in order to export or transfer a SAS file.
Valid in: CPORT Procedure, UPLOAD procedure, DOWNLOAD procedure
Restriction: You can specify only one translation table per TRANTAB statement. To specify additional translation tables, use additional TRANTAB statements.
Interaction: The TRANTAB statement specifies a customized translation table (for example, to map an EBCDIC character to an ASCII character) to apply to the character set in the SAS file that is being exported or transferred. The TRANTAB= system option specifies a translation table to use for the SAS session, including file transfers.


TRANTAB NAME=translation-table-name <TYPE=(etype-list)<OPT=DISP | SRC | (DISP SRC)>> ;

Required Argument

specifies the name of the translation table to apply to the SAS catalog that you want to export (PROC CPORT) or transfer (PROC UPLOAD or PROC DOWNLOAD). The translation-table-name that you specify as the name of a catalog entry in either your SASUSER.PROFILE catalog or the SASHELP.HOST catalog. The SASUSER.PROFILE catalog is searched first, and then the SASHELP.HOST catalog is searched.
In most cases, the default translation table is the correct one to use, but you might need to apply additional translation tables if, for example, your application requires different national language characters.
You can specify a translation table other than the default in two ways:
  • To specify a translation table for an invocation of the procedure, use the TRANTAB statement in the procedure, as appropriate.
  • To specify a translation table for your entire SAS session or job (including all file exports or transfers), use the TRANTAB= system option.

Optional Arguments

applies the translation table only to the entries with the type or types that you specify. The etype-list can be one or more entry types. Examples of catalog entry types include DATA and FORMAT. If etype-list is a simple entry type, omit the parentheses.
By default, the UPLOAD, DOWNLOAD, and CPORT procedures apply the translation table to all specified catalog entries.
OPT=DISP applies the translation table only to the specified catalog entries, which produce window displays.
OPT=SRC applies the translation table only to the specified catalog entries that are of the type SOURCE.
OPT=(DISP SRC) applies the translation table only to the specified catalog entries that either produce window displays or are of type SOURCE.
If you do not specify the OPT= option, the UPLOAD or DOWNLOAD procedure applies the translation table to all of the entries in the catalog that you specify.
Default:PROC CPORT, PROC UPLOAD, and PROC DOWNLOAD apply the translation table to all entries and data sets in the specified catalog.


Translation tables were introduced in SAS 6 to support the requirements of national languages. SAS 8.2 introduced the LOCALE= system option as an improvement on direct use of translation tables. SAS 9.3 supports the TRANTAB statement for backward compatibility. However, using the LOCALE= system option is preferred in later SAS releases. For more information, see TS-639, Data Conversion Issues in V6–V8. This technical support note provides information for customers using non-English languages
PROC CPORT is used when you transfer a SAS file across a network. PROC UPLOAD and PROC DOWNLOAD are used when you transfer a SAS file across a network.
You must specify the INCAT= and OUTCAT= options in the PROC UPLOAD or PROC DOWNLOAD statement when using the TRANTAB statement.


Example 1

The information that follows applies to procedure features:
  • PROC CPORT statement option: FILE=
  • TRANTAB statement option: TYPE=
This example shows how to apply a customized translation table to the transport file before PROC CPORT exports it. For this example, assume that you have already created a customized translation table called TTABLE1.

Example 2: Program

Assign library references. </userSuppliedValue>The LIBNAME and FILENAME statements assign a libref for the source library and a fileref for the transport file, respectively.
libname source
filename tranfile 'trans3';
proc trantab table=ascii;
save table=ttable1;

libname source 'SAS data-library';
filename tranfile 'transport-file'
Apply the translation specifics.</userSuppliedValue> The TRANTAB statement applies the translation that you specify with the customized translation table TTABLE1. TYPE= limits the translation to FORMAT entries.

proc cport catalog=source.formats file=tranfile;
   trantab name=ttable1 type=(format);

Example 3: SAS Log

NOTE: Proc CPORT begins to transport catalog SOURCE.FORMATS
NOTE: The catalog has 2 entries and its maximum logical record length is 104.
NOTE: Entry REVENUE.FORMAT has been transported.
NOTE: Entry DEPT.FORMATC has been transported.

See Also

Conceptual Information:
System Options:
CPORT Procedure in Base SAS Procedures Guide
UPLOAD Procedure in SAS/CONNECT User's Guide
DOWNLOAD Procedure in SAS/CONNECT User's Guide