Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
RealityV15.1Online Documentation (MoTW) Revision 7
TRANS Function (DataBasic MultiValue Compatibility) (m6187ai+trans_f.htm)
Extracts data from a file.
This function is provided for compatibility with other MultiValue systems.
TRANS({DICT }fileSpec, itemId, attrNo{, actionCode})
XLATE({DICT }fileSpec, itemId, attrNo{, actionCode})
DICT Specifies that the dictionary of the specified file should be used instead of the data section. This keyword can also be in lower case (dict).
fileSpec The name of file from which to extract the data, in the following format:
{/account/}filename{,data-section-name}
If both DICT and data-section-name are specified, data-section-name is ignored.
itemId The item-Id of the required source file item.
attrNo The number of the required attribute in the specified item.
actionCode An expression that evaluates to the following:
errorOp{[valueNo||:delimiter]}
errorOp The action to take if the specified item does not exist or the specified attribute is null. One of the following:
C Return itemId.
V Display an error message and return null.
XReturn null.
valueNo One of the following:
:delimiter Use delimiter to separate values and subvalues. If delimiter contains more than one character, only the first is used.
If actionCode is null the default is "X".
The extracted data.
TRANS and XLATE return the same value as:
OCONV(itemId,"T{DICT }fileSpec;actionCode;;attrNo;")
OCONV function, Tfile conversion code.
Assuming that the file TRANS.DATA contains the following item:
TRANS.ITEM
001 A
002 BAVMBBVMBC
003 CAVMCBASVMCBBSVMCBCVMCC
The following sets the variable ITEM to "BAVMBBVMBC":
ITEM = TRANS("TRANS.DATA", "TRANS.ITEM", 2)
and the following sets ITEM to the item-id, "TRANS.ITEM":
ITEM = TRANS("TRANS.DATA", "TRANS.ITEM", 4, "C")