Table of Contents

AddTranslation

Translate the value of a field based upon the current value of the field.

Phase

This instruction is used by the TapeTrack Import Engine.

Syntax

AddTranslation(field, filter, translation);

Variable Type Description Min Length Max Length
field String The field to be translated. 1128
filter String A filter to compare against the current field value.1256
translation String The new value of the field. This can either be a new literal value, or the original value with a prefix or suffix.1256
All AddTranslation instructions add to the translation table which is processed in the sequence in which the AddTranslations are coded in the definition file. Once a translation match is found for the target field no further translations will occur for that field within that record.
Although an AddTranslation2 is functionally equivalent to a AddTranslation with the same field and field2 values, AddTranslation entries are processed first, and then AddTranslation2 entries are processed a 2nd time. This allows you to translate the value of the field2 comparison field first, and then translate the value of the field based upon the translated value of field2.
To substitute the current field into the string use an asterisk (“*”). To substitute part of the current field into the string use a combination of tildes (“~”) and carets (“^”), where a tilde represents a character to include, and a caret represents a character to drop.

Example

Append L3 to each VOLUME field if the value starts with a zero.

AddTranslation(VOLUME, "0*", "*L3");

Truncate a VOLUME field to 6 characters when the Volume-ID starts with an A.

AddTranslation(VOLUME, "A*", "~~~~~~");

Remove the first 3 characters from a Volume-ID A12345678 and add suffix L4

AddTranslation(VOLUME, "A*", "^^^~~~~~~L4");

See Also

Import Engine Functions
Sync Engine Fields
TMSS10Sync