This is an old revision of the document!
−Table of Contents
addtranslation
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); string field; string filter; string translation;
<notetip> 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.</Note>
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. field The field to be translated. filter A filter to compare against the current field value. translation The new value of the field. This can either be a new literal value, or the original value with a prefix or suffix. Examples Example A.23. AddTranslation: Append L3 to each VOLUME field if the value starts with a zero. AddTranslation(VOLUME, “0*”, “*L3”); 70 Example A.24. AddTranslation: Truncate a VOLUME field to 6 characters when the Volume-ID starts with an A. AddTranslation(VOLUME, “A*”, “~~~~~~”);