Move
Moves data from source to target. (Replaces MoveNumeric, Normalize, Trim, TrimLeading, and TrimTrailing)
Move and the new Transformation Engine
As part of the evolving engine, improved Move rule functionality reduces the need for manual manipulation of your data during transformation by better inspecting and adhering to source and target Schemas. It is more consistent when reading and writing data; whether moving source data into a Ruleset variable, or directly to target, the Move rule respects the data type and other properties set in the Schema.
Trimming and padding of non-essential characters such as zeros and white spaces
Move automatically executes certain trimming, padding, and spacing behavior when moving data. This can be especially helpful when transforming fixed-length Flat Files. For example:
A field in your Flat File Schema has a starting position of “1” with a Length of “10”. The actual data being moved is “xxxxxxxabc”. ("x" represents 7 empty spaces in front of the data). In the old engine, you would need to use the Move Trim rule to handle these spaces. The new Move recognizes these spaces and automatically removes them for you. The target value in this case is “abc”.
Formatting implied decimals in both source and target data
- For Fixed-length Flat Files, the Move rule uses the Flat File Schema properties Length and Fractional Digits when reading from and writing to implied decimals.
- For delimited Flat Files, Move uses the Flat File Schema property Fractional
Digits to read implied decimals.
- When writing implied decimals, Move uses Fractional Digits and Total Digits.
- For target, when the length of data is less than Total Digits, the engine automatically pads the output with zeros. However when data length is greater than Total Digits, an exception will be thrown.
- For EDI (X12), the Move rule uses the EDI Schema settings Min Length and Max Length for implied decimals in source and target. Source numeric data values not containing a decimal will have the decimal point added at the implied position. Target numeric values containing decimal positions equal to the implied value have their decimals removed.
- For Database, the Move rule uses the Database Schema property Fractional Digits and Length when working with ImpliedDecimal JDBC type. Values that contain commas (,) or brackets ([]) will not conflict with keywords and delimiters. The engine removes trailing NULL values at the end of the record.
Converting dates into the new DateTime data type
Move now automatically converts a date into the new DateTime data type. It is also capable of reading dates with values not well-formed.
Better error messages provided when moving incompatible data types or violating other Schema properties.
Below are some examples of error messages that may appear when the engine prevents data from being moved.
Cause of error | Error Message |
---|---|
String exceeds maxLength in target | InvalidDataFormatException: Length of value 'ABCDEFGHIJ' is greater than max length '9' specified in the field 'StringLength10_Max9' |
Moving string to number | Incompatible types. Expected Number but was String. |
Moving decimal to integer | InvalidDataFormatException: The value '555.55' can not be converted to Integer. Field 'IntLength8_Min5'. |