In illustration purposes, we’re using the following set of application data:
H|810|ZZ|0123456789|ZZ|ABCD|AB123||SA|232324||20190610|20190519||00112234|
D|810|1|12|1.11|13.32|IN|11111111|SK|1234|VN|87981|EA|3|1|
D|810|2|9|2.22|119.98|IN|12121212|SK|2346|VN|87982|EA|3|1|
D|810|3|24|3.33|79.92|IN|13131313|SK|3456|VN|87983|EA|3|1|
D|810|4|18|1.21|21.78|IN|14141414|SK|4567|VN|87984|EA|3|1|
D|810|5|15|2.32|34.80|IN|15151515|SK|5678|VN|87985|EA|3|1|
D|810|6|21|3.43|72.03|IN|16161616|SK|6789VN|87986|EA|3|1|
S|X|810|241.11|99|
The usual and default setting is “Data selection is based on loop iteration” with Loop Iteration Offset = 0. This places the data hunt in the “current” application data looping for each pass through the data. When all the mapped loop elements use this default, our output is as so:
BIG|20190607|14140|20190305|2074997
IT1|1|12|EA|1.11||IN|11111111|SK|1234
IT1|2|9|EA|2.22||IN|12121212|SK|2346
IT1|3|24|EA|3.33||IN|13131313|SK|3456
IT1|4|18|EA|1.21||IN|14141414|SK|4567
IT1|5|15|EA|2.32||IN|15151515|SK|5678
IT1|6|21|EA|3.43||IN|16161616|SK|6789VN
TDS|241.11
Now, if we change the IT101 to use “Data selection is based on the entire document”, the IT101 is changed to be an incorrect value for ALL passes through the data – “ZZ”.
BIG|20190607|75797|20190305|6183396
IT1|ZZ|12|EA|1.11||IN|11111111|SK|1234
IT1|ZZ|9|EA|2.22||IN|12121212|SK|2346
IT1|ZZ|24|EA|3.33||IN|13131313|SK|3456
IT1|ZZ|18|EA|1.21||IN|14141414|SK|4567
IT1|ZZ|15|EA|2.32||IN|15151515|SK|5678
IT1|ZZ|21|EA|3.43||IN|16161616|SK|6789VN
TDS|241.11
There are valid reasons to change these settings. However, care needs to be taken when changing this option, as incorrect data can result.