|The name of a MultiValue file defined in the VOC. An expression that resolves to a string. If there are multiple defined data sections (data files), you can specify mvfile as either "filename,datasection" or simply "datasection".
|The record ID of the desired record. An expression that resolves to a string (commonly a positive integer). This argument can be multivalued in which case TRANS returns multivalues.
|An expression that resolves to either an integer or a non-numeric string. If an integer, fieldno specifies the field number of the field to be read, or, if -1, returns the contents of the entire record. This usage is compatible with most MultiValue systems. If a non-numeric string, fieldno specifies an attribute to look up in the file's dictionary. If that attribute is a “D” data defining entry, TRANS looks up the data using the corresponding field number recorded in the dictionary. This usage is compatible with UniData systems.
|A letter code that specifies what to do if the requested record does not exist. An expression that resolves to a quoted string.
The TRANS function returns a field value from a MultiValue file. Unlike a READ statement, you do not have to use the OPEN statement to open the MultiValue file before issuing a TRANS.
The code argument determines how TRANS should respond when you request an invalid field. The following are valid letter codes:
|Return an empty string if the specified record or field cannot be located.
|Return an empty string and generate an error message if the specified record or field cannot be located.
|Return the recID value if the specified record or field cannot be located.
|Return the recID value if the specified field value is null.
The TRANS and XLATE functions are functionally identical.
The following example illustrates the use of the TRANS function:
mydyn = TRANS("TEST.FILE",1,1,"X")
PRINT "the field value:",mydyn