File Translation

Format

T[DICT] filename ; c [vloc] ; [iloc] ; [oloc] [ ;bloc]
T[DICT] filename ; c ; [iloc] ; [oloc] [ ;bloc] [ ,vloc | [vloc] ]

The Tfile code converts values from one file to another by translating through a file. It uses data values in the source file as IDs for records in a lookup file. The source file can then reference values in the lookup file.

To access the lookup file, its record IDs (field 0) must be referenced. If no reference is made to the record IDs of the lookup file, the file cannot be opened and the conversion cannot be performed. The data value being converted must be a record ID in the lookup file.

Table 1. File translation
Argument Explanation Notes
DICT

Specifies the lookup file's dictionary. (In REALITY flavor accounts, you can use an asterisk ( * ) to specify the dictionary: for instance, T*filename ... .)

 
filename

Name of the lookup file.

 
c

Translation subcode, which must be one of the following:

 
  V Conversion item must exist on file, and the specified field must have a value, otherwise an error message is returned.
  C If conversion is impossible, return the original value-to-be-translated.
  I Input verify only. Functions like V for input and like C for output.
  N Returns the original value-to-be-translated if the null value is found.
  O Output verify only. Functions like C for input and like V for output.
  X If conversion is impossible, return an empty string.
vloc

Number of the value to be returned from a multivalued field. If you do not specify vloc and the field is multivalued, the whole field is returned with all system delimiters turned into blanks. If the vloc specification follows the oloc or bloc specification, enclose vloc in square brackets or separate vloc from oloc or bloc with a comma.

 
iloc

Field number (decimal) for input conversion. The input value is used as a record ID in the lookup file, and the translated value is retrieved from the field specified by the iloc. If the iloc is omitted, no input translation takes place.

 
oloc

Field number (decimal) for output translation. When RetrieVe creates a listing, data from the field specified by oloc in the lookup file are listed instead of the original value.

 
bloc

Field number (decimal) which is used instead of oloc during the listing of BREAK.ON and TOTAL lines.