Translate

Filter:

XLATE

Syntax:

XLATE [columnrange] [translate_table]

Operands:

columnrange :: start_column "-" end_column
columnrange :: start_column "." number_of_columns
translate_table :: UPPER | LOWER | E2A | A2E | delimiter tablei delimiter tableo delimiter
tablei :: input character table
tableo :: output character table
start_column :: integer | *
end_column :: integer | *
number_of_columns :: integer
delimiter :: Any character not used in tablei or tableo

Functional Description:

Use the XLATE stage to replace characters according to a translate table. XLATE reads records from its primary input stream, compares and replaces characters according to the translation specification, and writes the resulting records to its primary output stream, if it is connected. The output record has the same length as the input record.

If no translate table operands are specified, XLATE defines the translate table as the uppercase table.

You can use XLATE to translate entire records or specified locations of the input data in the record. You can specify locations of the input data in terms of columns. Input data that is outside all specified locations is left unchanged.

UPper specifies that lowercase alphabetic characters are converted to uppercase; uppercase letters remain unchanged. If you do not specify any operands for the XLATE stage or if you specify only column ranges, characters in the input records are translated to uppercase.

LOWer specifies that uppercase alphabetic characters are converted to lowercase; lowercase letters remain unchanged. If the uppercase translate table translated two or more characters to a particular uppercase character, when translating from uppercase to lowercase, the character with the lower hex value is used.

A2E specifies that an ASCII-to-EBCDIC translation is performed where characters are changed from the ISO 8859 Latin Character Set 1 (Western Europe) characters to the characters from code page 500.
Note that if the entire record is to be translated then this will include translating the line_end character of each record from ASCII to EBCDIC. Therefore the records will no longer appear delimited on an ASCII system.

E2A specifies that an EBCDIC-to-ASCII translation is performed where characters are changed from code page 500 characters to the ISO 8859 Latin Character Set 1 (Western Europe) characters.
Note that this feature will not function correctly for full records on an ASCII machine. This is due to the inability of recognizing the EBCDIC line_end character to delimit each record during pipe input processing.

Secondary Input/Output:

NONE

Synonyms:

none

Usage Notes:

Since ASCII and EBCDIC have somewhat different character sets, not all characters will translate without problems. In particular, there is no equivalent of most IBM graphics characters. Therefore, if you translate a file to EBCDIC and then back again to ASCII, you may not have the same file again. Some punctuation and most control and graphics characters will have changed.

XLATE UPPER

The following example will translate columns 1 through 20 to lowercase:

XLATE 1-20 lower

The following example will translate all records from ASCII to EBCIDIC:

XLATE A2E

The following example will translate all matching characters in columns 1 to 10 from ABC to xyz.

XLATE 1-10 /ABC/xyz/


JAVA Pipelines

Cullen Programming logo