This post is driven by discussion on fixprotocol.org about message parsing and user defined fields (UDF) in repeating groups.
The main concern is if you really need to correct a dictionary when adding UDF to the repeating group or message can be parsed just based on the standard. Popular (and theoretically correct) answer is yes, you should modify dictionary. But in fact there is something you can do without dictionary and still be able to parse such messages properly.
The main concern is if you really need to correct a dictionary when adding UDF to the repeating group or message can be parsed just based on the standard. Popular (and theoretically correct) answer is yes, you should modify dictionary. But in fact there is something you can do without dictionary and still be able to parse such messages properly.
When you parse repeating group you know several things about it:
- From the leading tag you know the number of entries
- From the standard you know the start tag, which is alway required for repeating group
When you parse particular entry of the repeating group and it is not the last entry (you can easily find out that by counting start tags) you can consider all UDFs as part of this repeating group.
When you parse the last entry and you find UDF, which appeared in previous entries you can also consider it as a part of repeating group.
What you CANNOT do:
- If you find UDF the first time when parsing the last entry of the repeating group you cannot decide if it belongs to repeating group or body (actually you can check if it is followed by the tag defined for repeating group but this is too much).
- If message is invalid i.e. contains incorrect number of entries you cannot make correct decision.
After all keep in mind that all these "guesses" slow down your parsing so think twice whether you really need it and then think one more time. :)
Some additional links are under cut.
Some additional links are under cut.