TRANSLATE

From BR Wiki
Revision as of 16:08, 8 May 2014 by Laura (talk | contribs)
Jump to navigation Jump to search
TRANSLATE=<file ref>

The "TRANSLATE=file-ref" parameter indicates that character translation is required for all input or output of C, V, G, N, ZD or PIC strings. The file-ref must identify either a 256- or 512-byte file. The first 256 bytes are used as an input translation table.

This optional parameter allows the translation of data to or from another collating sequence. Internally, all computers represent letters of the alphabet, punctuation marks and even digits according to an arbitrary numbering scheme. Today, the common coding schemes is ASCII (American Standard Code for Information Interchange). In the past, EBCDIC (Extended Binary Coded Decimal Interchange Code) was used, especially for main frames. Probably the most common use of the TRANSLATE= capability is translating files between ASCII and EBCDIC.

An example of the difference between ASCII and EBCDIC is that the uppercase letters A, B and C are represented by 65, 66 and 67 respectively in ASCII; but in EBCDIC, they are 193, 194 and 195. Also, in ASCII, the blank or space character is represented by the number 32 while in EBCDIC it is number 64. Although all systems that currently run Business Rules the ASCII coding scheme, some older computer systems use EBCDIC.

Used in Open statements: Display, Internal, external, and communications.

See also the XLATE$ internal function.