Hello Phanee,
Could you see if this works for you?
The split can be designed using a hybrid record-count and control-break approach, enforce a 99-row limit per file, but align the split boundary to the last unique OrderNum so that transactional integrity is preserved across output XMLs.
Detailed Resolution:
We can solve this by using a row counter along with a check on the OrderNum:
- Count rows up to 99.
- When you hit row 99, look at the next row:
- If it has the same OrderNum, then go back to the last row where the OrderNum changed and split there.
- If it’s different, just split at 99.
- Create a new XML file each time you split and keep repeating this until the CSV is done.
- This way:
- No file will go over 99 rows.
- An OrderNum will always stay together in one file.
- The number of files depends on how many rows and orders are in the input.