MRM TDS format: Delimited separation types
For delimited separation types, a delimiter is used to separate data fields, but there are no tags present. The data fields must be given in the correct order in the bit stream and elements cannot be omitted from the middle of the bit stream.
data1*data2*data3*data4
- The elements must be given in the order specified.
- No element can be omitted in the middle of a group or complex type, because the parser cannot determine this from the resulting bit stream.
- Elements can sometimes be absent from the end of a complex type or group.
Delimiter suppression and truncation rules
- Elements cannot be omitted from the middle of a group or complex
type. An absent element results in the inclusion of a zero-length
string. For example, with all elements present, the string might be:
where Delimiter is *data1*data2*data3*data4
Ifdata2
is missing, the string would read:data1**data3*data4
- It is possible to suppress the delimiters at the end of a string
for absent elements. The Suppress
Absent Element Delimiter property determines whether this
is done. If this property is set to End
of Type, this can be done (with one exception, shown later
in this section). In this case, for the example with
data3
anddata4
missing, the string would read:
That is, the delimiters have been suppressed from the end of this group or complex type.data1*data2
- If the Suppress Absent Element
Delimiter property is set to Never,
delimiter suppression never takes place. The string would read:
That is, the delimiters must be present to indicate absent (zero-length) elements.data1*data2**
An exception to the above rule occurs in the case where the same delimiters are used at multiple levels in the model.
For example, you have a complex type or group with delimiter * and this contains an element of another complex type (indicated by theelement3
prefix on data fields in the following example), which also has delimiter *. If both types use a delimited separation type, with all elements present, you might have:data1*data2*element3Data1*element3Data2*element3Data3*data4
If
element3Data2
andelement3Data3
are missing, and the delimiters are suppressed, it is not possible for the parser to determine which elements are missing.Therefore, in this case, you must override the Suppress Absent Element Delimiter property, and write out all the delimiters to clearly define the message to the parser. Therefore, the string must be:data1*data2*element3Data1***data4
This restriction also applies where Group Indicators and Group Terminators use the same character strings as delimiters; otherwise, the bit stream is not clear to the parser.
All Elements Delimited
data1*data2*data3*data4*data5
where Delimiter is *.An All Elements Delimited separation type does not use tags or their associated parameters.
For textual elements, the length is determined by the delimiter, and the Length property is ignored unless the Observe Element Length property is set.
For non-textual elements, the length is determined by the Physical Type of the element. See MRM TDS format: Determining the length of simple data values.
Applicable properties for All Elements Delimited
- Group Indicator indicates the start of a group or complex type.
- Group Terminator indicates the end of a group or complex type.
- Delimiter indicates the separator between the data elements within a group or complex type.
- Suppress Absent Element Delimiters indicates whether delimiter suppression is permitted.
{data1*data22222*data3}
where:
- Group Indicator is {
- Group Terminator is }
- Delimiter is *
Repeating element rules for All Elements Delimited
If an element must be repeated when the separation type is All Elements Delimited, the Repeating Element Delimiter (RED), is used to separate the repeated elements.
data2
repeats five times: data1*data2:data2:data2:data2:data2*data3*data4
where:
- Delimiter is *
- Repeating Element Delimiter is:
data2
element
was present in the previous example, the bit stream reads: data1*data2*data3*data4
data1*data2::::*data3*data4
data1*data2**data3*data4
Variable Length Elements Delimited
- If a length is present for a textual element, it is used, and a delimiter is not needed to terminate that element. The element must be padded to the correct length, and cannot exceed that length.
- If no length is given for a textual element, the delimiter is required.
- For non-textual elements, the length is determined by the Physical Type of the element. See MRM TDS format: Determining the length of simple data values.
A complex type with Variable Length Elements Delimited separation that contains only variable length elements resembles a complex type with All Elements Delimited separation. If it contains only fixed-length elements, it resembles a Fixed Length type.
data1*data2*data3*data4000data5
where:
- Delimiter is *
data4
has a length of 8
Applicable properties for Variable Length Elements Delimited
- Group Indicator indicates the start of a group or complex type.
- Group Terminator indicates the end of a group or complex type.
- Delimiter indicates the separator between the data elements within a group or complex type.
- Suppress Absent Element Delimiters indicates whether delimiter suppression is permitted.
- (Optionally) Length or Length Reference indicates the length of a textual element. If a textual element has a length, this length is used. Because the length of this element is known, it is not necessary to output a delimiter after it. If the length is not known, a delimiter is required. A delimiter is never required for a non-textual element.
data4
)
is of fixed length 8 and its padding character is 0
:
{data1*data22222*data3*data4000data5}
where:
- Group Indicator is {
- Group Terminator is }
- Delimiter is *
Repeating element rules for Variable Length Elements Delimited
The action of a repeating element in a Variable Length Elements Delimited environment is dependent on the minimum and maximum number of repeats and whether the element has a length.
Delimited Element Repeating
If a delimited element (that is, an element with no length) is repeated, a Repeating Element Delimiter (RED) is required and the rules for All Elements Delimited are followed. A delimiter is therefore required after the last repeat. Delimiter suppression of this repeat can also occur.
data2
is repeating: data1*data2:data2:data2:data2:data2:data2*data3*data4000data5
where:
- Delimiter is *
- Repeating Element Delimiter is :
data4
has a fixed length of 8
If the Suppress Absent Element Delimiters field is set to End of Type, you can use delimiter suppression.
data2
is
present: data1*data2*data3*data4000data5
data1*data2:::::*data3*data4000data5
data1*data2**data3*data4
This also applies for a non-fixed length complex type or group inside a Variable Length Elements Delimited environment.
Fixed Length Element Repeating
If an element with a defined length (a fixed-length element) is repeating and the minimum occurrences is not the same as maximum occurrences, an RED is not required, but a delimiter is required after the last repeat. Delimiter suppression of this repeat can occur.
data4
(with a fixed length of
8) is repeating, and its minimum occurrences is 2, maximum occurrences
is 4: data1*data2*data3*data400data400data400data400*data5
where Delimiter is * data4
:
data1*data2*data3*data4000data4000*data5
If an element with a defined length (a fixed-length element) is repeated, and the minimum occurrences is the same as maximum occurrences, an RED is not required. A delimiter is also not required after the last repeat. Truncation of this repeat cannot occur and all elements need to be present.
data4
(with a fixed length of
8) repeats four times: data1*data2*data3*data4000data4000data4000data4000data5
where Delimiter is * data4
:
data1*data2*data3*data4000data40000000000000000000data5
This also applies for a non-fixed length complex type or group inside a Variable Length Elements Delimited environment.
If a complex type has Variable Length Elements Delimited separation, a delimiter is always output between an included ('child') complex element and the next element even if the separation of the 'child' complex element is Fixed Length. On input, the parser accepts the bit stream with or without such a delimiter.