MOVE EXACT source TO destination.
If an assignment is made between incompatible data objects, the
MOVE statement ensures that the assigned content is checked before the assignment is made to establish whether a
lossless assignment is possible, namely whether:
- The value is valid for the data type of the source field
- The assignment to the target field can result in a loss of values
The value is valid for the target field after conversion
If the source field contains a valid value and no values are lost, the assignment is made in
exactly the same manner as without the
addition. Otherwise no assignment is made. If it is statically identifiable that one of the prerequisites
laid down by
EXACT is not met, a syntax error occurs. If this violation is
not identified until the program is executed, a handleable exception is raised. The exception class of this exception is generally a subclass of CX_SY_CONVERSION_ERROR.
The following sections outline which rules the
EXACT addition considers when checking the assigned content based on the data types involved:
If an exception is raised as a result of an invalid or inappropriate value, the VALUE attribute of the exception object is assigned this value in character form; this value is generally also included in the exception text.
If an exception is raised when the
EXACTaddition is used, the statement is not executed and the value of the target field remains unchanged. In assignments made without the
EXACTaddition, the target field contains an undefined value when an exception is handled.
Since the checks for the
EXACTaddition are only carried out when assignments are made between incompatible data objects, we recommend that
MOVE EXACTis used to populate data objects that are to be assigned valid values only. Other types of assignments that require a start value to be specified in the declaration using VALUE can generate invalid values that are then not recognized when a lossless assignment is made to a compatible target field.
See Exact Assignment.
Cause: Invalid type or length combinations in