You can use elementary field names, virtual field names, and group field names as value expressions.
1 – Elementary and REDEFINES Field Names
The value specified by an elementary field name is the value stored in a field of a record. If the field name you use refers to a REDEFINES field, the value associated with the name is determined by the clauses that define the REDEFINES field in the record definition.
2 – COMPUTED BY Fields
COMPUTED BY fields are virtual fields. DEC DATATRIEVE does not store the value of a COMPUTED BY field in a record. That value is calculated every time you refer explicitly or implicitly to a COMPUTED BY field. The COMPUTED BY clause includes a value expression. The value specified by the virtual field is associated with the value expression in the COMPUTED BY clause.
3 – Group Field Names
When you use group field names in assignment statements, the value of the group field depends on the type of assignment you specify. For example: o group-field-name-1 = group-field-name-2 In this type of assignment, the value of group-field-name-2 includes the values of all elementary fields, all REDEFINES fields, and all COMPUTED BY fields. The assignment of values is made on the basis of similar field names. For field names in group-field-1 that match names in group-field-2, DEC DATATRIEVE assigns the values in group-field-2 to the appropriate fields in group-field-1. DEC DATATRIEVE ignores any fields in group-field-2 whose names do not match any field names in group-field-1. For any elementary field in group-field-1 whose name matches none of the field names in group-field-2, DEC DATATRIEVE assigns the MISSING or DEFAULT value if one is defined for the field, or a value of 0 if the field is numeric, or a blank if the field is alphabetic or alphanumeric. DEC DATATRIEVE stores no values in any COMPUTED BY or REDEFINES fields in group-field-1, regardless of any matches between the names of those fields and fields of any type in group-field-2. The values of the elementary, REDEFINES, and COMPUTED BY fields associated with group-field-name-2 are the values stored in or associated with the fields that constitute group- field-2 of a record. o elementary-field-name = group-field-name Because of problems that can arise from conflicting data types, assignments of this type are not recommended. If you make an assignment of this type, the value of the group field is the same value displayed when you enter a DISPLAY group-field-name statement. The value is the concatenation of the values in the elementary fields that constitute the group field. The REDEFINES and COMPUTED BY fields are ignored. You can reduce conflicts of data types by using an alphanumeric PICTURE string in the definition of the elementary field.
4 – Query Names
If the record definition contains a query name for a field, you can use the query name exactly as you use the associated field name.
5 – Qualifying Field Names
To clarify the context for recognizing names and associating values with those names, you can qualify field names with several optional elements: o Context variables Distinguish between fields in different record streams. o Collection names Distinguish between fields in selected records in different collections. You can use a collection name to modify a field from a selected record only. o Domain names Distinguish between fields that have the same field name but are associated with different domains. o Record names Distinguish between fields that have the same field name but are contained in different records. o Group field names Distinguish between fields that have the same field name but are contained in different group fields. Use the following format to specify field names: [ collection-name ] [ context-variable ][domain-name] [group-field-name] [...] field- [ ] name For duplicate field names, you must specify whatever option or combination of options is needed to make the name unique.