Originally posted by: mohit121happy
Objective :
We have multiple occurrence of some data in WTX, which gets passed to functional map one by one.
The problem is to extract some specific information from only those next records which have value ZERO for one of the field and merge it into the record which comes before it and have Non ZERO value.
Description :
In WTX multiple data passes to Functional Map one by one, it can be read and write as per requirement.
But problem is to check the next records which have value ZERO in one of the field and only extract the specific information from it to merge into its previouse Non Zero record.
No need to write those ZERO Records in the Output.
Here in our case, the only information that available is, we have to extract some specific information from only those next records which have value ZERO for one of the field and merge it into the record which comes before it and have Non ZERO value.
See Below Example.We have Input file(Fixed Length) like below :
SM Records
DT1 Record -
Amount 20 | Reference ABC
DT2 Record -
Amount 00 | Reference DEF
DT3 Record -
Amount 00 | Reference GHI
DT4 Record -
Amount 30 | Reference JKL
DT5 Record -
Amount 00 | Reference MNO
Output :
In Output, we have to merge the Reference value of DT Records for Amount 00 into its previouse DT Record which have Amount not equals to 00.
For eg :
As DT2 Record have Amount 00, so we have to extract its Reference(i.e DEF) and merge it into the DT1 Record because it has Amount Non Zero .
Again DT3 have Amount 00, so merge it to its previouse Non Zero DT Record i.e DT1 .
Same should be applicable for DT4 and DT5.
As you can see that DT5 have Amount = 00, and hence it should be merge into its prior Non ZERO DT Record i.e DT4
#IBMSterlingTransformationExtender#IBM-Websphere-Transformation-Extender#DataExchange