For tagged separation types, each data value is preceded by a tag that is specified as an element property.
The Tag Data Separator, or specific Length of Tag parameter is used to determine where the tag ends and the data starts. Different methods are used by each separation type to determine the end of the data.
Tagged separation is a flexible format. The elements do not have to occur in a specific order. They do not all need to be present, and can be absent from any point in the message.
Either Tag Data Separator and Length of Tag are used by all tagged separation types. But only one of these parameters can be set at the same time.
tag1:data1where Tag Data Separator is :
tag1data1where Length of Tag is 4
Tagged Delimited separation is a completely flexible format. The elements are not of specific lengths. Elements are separated by a predefined delimiter.
{tag1:data1*tag2222222:data2*tag333:data3}where:
{tag11data1*tag22data2*tag33data3}where parameters are as above, except:
Although Tagged Fixed Length separation is a flexible format, the data must be a specific length. This means that a delimiter is not needed to determine the end of each element.
{tag1:data1tag22222222:data2000tag333:data300}where:
{tag11data1tag22data2000tag33data300}where parameters are as above, except:
This method has both a tag and a length field before the data. The length field indicates to the parser the length of the data following it.
The length of this length field is itself defined in the Length of Encoded Length parameter. Extra lengths to be added in this, such as the length of the field itself, is set in the Extra Chars in Encoded Length parameter.
These examples show how the values set in these parameters are applied:
If Length of Tag is 4, Length of Encoded Length is 3, Extra Chars in Encoded Length is 0, then in this bit stream, TagA is followed by the 3 character long length field. This indicates that the following data (dataAAA) is 7 characters long. The next field, tagB is then considered, and so on.
If Length of Tag is 4, Length of Encoded Length is 3, Extra Chars in Encoded Length is 3, then in this bit stream, TagA is followed by the 3-character length field. This indicates that the following data, plus extra characters, is 12 characters long: length of the length field (3) + length of data (9) = 12. Therefore the length of the actual data is only 12-3 = 9. The next field, tagB is then considered, and so on. In each case the length given in the bit stream is 3 greater than the actual length of the data.
{tag1111:008data1tag222222222:010data2AAtag3333:009data3A}where:
{tag11008data1tag22010data2AAtag33009data3A}where parameters are as above, except: