As part of the new transformation engine's Ruleset improvement, several new actions have been added. These replace certain actions that were used for v1 Rulesets.
New Ruleset Action | Replacement details |
AddDateTimeWithFields | This Action replaces the older AddDays and AddHours Actions. |
FormatDateTime | This Action replaces the older ConvertDateFormat Action. |
GetCurrentDateTime | This Action replaces the older GetCurrentDate and GetCurrentTime Actions, because the return value is being specified. |
GetDaysBetween | This replaces the older GetDaysDifference Action. |
ExtractDigits | This Action replaces much of the functionality in the older MoveNumeric. This does not include Comma (,), Decimal (.), or Negative Sign (-). |
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
Move also formats implied decimals with less manual intervention. The decimal position is defined in either the source or target Schema for the particular syntax category (Flat File, EDI, or Database, etc). For example:
- For Fixed-length Flat Files, the Move rule uses the Flat File Scheulation 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
- Move also formats implied decimals with less manual intervention. The decimal position is defined in either thema 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'. |
RawMove
RawMove transfers data at face value. Unlike Move, it does not facilitate automatic trimming/padding/spacing behavior.
Raw move gets around the new move rule's automatic formatting by moving data literally and regardless of Schema settings. It allows you to retain data intact as it is moved; it can prove helpful when default Move rule formatting is not the desired result.
In this example, the underscore represents empty spaces. RawMove()[_ _ _ _ xyz] -> [_ _ _ _ xyz]
Here the four empty spaces have moved and are intact. Compared to…
Move()[_ _ _ _xyx] -> [xyz]
Note now that the four empty spaced were trimmed when moving to target.
If you are accustomed to the functionality associated with the Move rule for the older transformation engine (in the version 1 Ruleset ), the RawMove can be used instead of Move.
Related Topics
Comments
0 comments
Please sign in to leave a comment.