Troubleshooting
Problem
IBM WebSphere Transformation Extender (WTX) Map results are incorrect or inconsistent due to data binding.
Symptom
The map rule appears to be correct, in that there is data to match the values referenced in the map rule, but the output is either empty or incorrect.
Cause
The most common reason for this problem is usually referred to as Data Binding. This means having the same object from a series occurring more than once in the map rule or having an object in the map rule that belongs to the same common path as another object in the map rule, and that common path corresponds to a series.
Diagnosing The Problem
To determine if Data Binding is occurring, check the map rule to look for more than one object with a common path.
Resolving The Problem
There are a number of WTX functions which are considered “Series consuming”. What this means is that the function will normally have the ability to perform processing against multiple occurrences of an object (a “Series”) such as looking up a value for a record of a file based on a key field (for example a LOOKUP function).
However, when a particular object is referenced in a map rule more than once, all the references are to the same instance of that object. The following rule illustrates this common path:
=if(PRESENT(LOOKUP(Record:input,
Field1 Field:Record:input="aa")),
f_map(LOOKUP(Record:input,
Field2 Field:Record:input="2")),
NONE)
The common path in the map rule is Record:input. The map rule is attempting to verify the presence of a particular object in a path (Field 1 of Record Input). Then if that object exists, do a LOOKUP of another object (could be the same one) in the same common path based on a certain criteria. This will most likely return a NONE as a result.
Once the WTX engine finds the first Object, it binds the record to which this object belongs. Any other reference to the common path in the map rule will assume that the record to apply the function to is the same one that is “bound”. In this case, if Field2 for the record that is “bound” does not match “2”, then the result will be NONE.
Solution
Data binding is a complex subject to understand and finding a Data Binding condition might be difficult at times. In general, a good rule is to look for objects in the map rule that have the same common path and try to resolve this commonality. Redesign of the map or map rule will be necessary most of the time.
The following are possible solutions:
- Use the word IN to resolve common paths.
- Divide the map rule into functional maps and resolve the logic for the common objects at different levels.
- Use more than one input card that points to the same object and in the map rule point to the common object from different input cards.
The attached zip file includes one example source map (sample.mms) with 3 executable maps. The Sample_bad shows the Data Binding problem and running this map will result in an Empty output. The Sample1_good executable map shows the solution using IN to resolve the common path problem. The Sample2_good executable map shows dividing the logic into different levels of functional maps. Both Sample1_good and Sample2_good executable maps will result in the correct output data.
Note: Not all scenarios are the same so good mapping expertise might be required to detect the more complex scenarios. These two alternatives have corrected the majority of cases. The third alternative of repeating the input data and pointing to each different input card in the map rule is also a good option. However, it might create some confusion during the design and additional overhead, especially in cases of large data files.
Product Synonym
Mercator DataStage TX Ascential
Was this topic helpful?
Document Information
Modified date:
23 June 2018
UID
swg21408718