Data Transformation Engine What's New Reference Guide
Chapter 7 – Version 6.0 Mercator Design Studio Enhancements
What's New Reference Guide
37
Returns a type object whose content matches the input type object, but whose
syntax matches the output type object.
For example,
MyXMLPurchaseOrder = REFORMAT(MyCOBOL_PurchaseOrder)
This function is useful when the same type structure may come from different type
trees, such as different versions of the same EDI, or when converting legacy
formats to XML.
SUBSTITUTE Extended for Multiple Arguments
The SUBSTITUTE function has been extended to include multiple pairs.
Syntax
SUBSTITUTE (
single-text-expression
{ ,
single-text-expression
,
single-text-expression
} )
Meaning
SUBSTITUTE (
item_to_convert
,
one-or-more-text-substitution-
pairs
)
Where each
one-or-more-text-substitution-pair is
text_to_change
,
substitute_text
This function returns the text string that results from replacing all instances of the
first
text_to_change with substitute_text in item_to_convert, then
replaces all instances of the
second text_to_change with the second
substitute_text in the result of the first substitution, and so on.
Examples
SUBSTITUTE ("123*456*7" , "*" , "/" )
replaces the “*” in “
123*456*7” with “/” and returns “123/456/7”
SUBSTITUTE ( "120-45-6789" , "-" , "" )
removes all occurrences of “-“ in “120-45-6789” and returns 120456789
The following example illustrates multiple iterative replacements by using two
replacement pairs: