pc.translate Processing Code/Restore Processor

pc.translate

Command pc.translate Processing Code/Restore Processor
Applicable release versions: AP, R83, R83 2.0, R83 3.1
Category Restore Processor (84)
Description uses the presented value as an item-id and attempts to retrieve the corresponding item in another file to obtain a value from one of its attributes to substitute.

The attribute referenced in attribute 2 of the attribute-defining item is assumed to be an item-id in the specified file.reference, except in cases where the attribute count is "derived", such as in the case "f;3;2;*(tabc;x;;1)".

"file.reference" is the name of the file used for the translation.

"subcode" designates how to behave if the requested item is not on the "lookup" file. See available "subcodes" listed under "options".

"vc" (value count) is used with multi-valued attributes, and specifies the multi-value position to be returned. For example, if an attribute contains six multi-values, and "vc" is 4, the fourth multi-value is returned. If the specified multi-value contains subvalues, the subvalues are returned concatenated with blanks. Alternately, an "*" (asterisk) may be specified as the "vc", when following the "c" or "x" subcode. The "*" is used when translating a multi-valued attribute into a multi-valued attribute. For example, when processing the third value of a multi-valued attribute, the third value of the translated attribute is returned. If the corresponding value does not exist, a null is returned.

If "vc" is not specified, all the multi-values in the attribute are returned, concatenated with blanks.

"inac" (input attribute count) specifies the attribute number used for input translation. The data value is used as the item-id in the file specified by file.reference, and the translated value is retrieved from the attribute specified by "inac". If "inac" is not specified, no input translation takes place.

"outac" (output attribute count) specifies the attribute number used for output translation. When a listing is generated using Access, the attribute values specified are looked up in the file specified by "file.reference" and the attribute specified by "outac" is listed instead of the original value.

"breakac" (break attribute count) if specified, is used instead of the "outac" during the listing of break-on and total lines.
Syntax t{dict }file.reference;subcode{[vc|*]}; inac;outac{;breakac}
Options c Converts, if possible. If the item in the translate file does not exist or the specified attribute is null, the original value is used.

i Verifies input only. This subcode functions as a "v" subcode for input, and as a "c" subcode for output.

o Verifies output only. This subcode functions as a "c" subcode for input and as a "v" subcode for output.

v Specifies that a conversion item must exist and the specified attribute must have a value, otherwise an error message displays. This is for verification only, and the item-id is the only data returned.

x Converts, if possible. Otherwise, it returns a null value.
Example
Purpose
Related output-conversion
translate.code
basic.iconv
processing.codes
basic.oconv
up.input-conversion.adi
pc.index.remote
up.correlative.adi
pc