Developer Documentation Library > Data Model > UNICOM Intelligence Data Model accessories > Metadata Model to Quantum > Support for Triple-S export
 
Support for Triple-S export
This section provides information on allocating columns for multipliers to support Triple-S export.
Variables of type Single
Data for Singles can be recorded as either numeric codes or literal strings.
Numeric codes
Data is recorded as an integer number or 0 (zero) as described by the <values> element. The data field length is derived from the <value> and <range> elements in the <values> element, and is the minimum number of characters required to represent the largest value. Thus, variables with values up to 9 have a data field one character long; variables with values up to 99 have a data field length of 2, and so on. If a particular data value requires less than the maximum for the field, it should be right justified using leading space or zero characters as padding.
If the data field length from each <value> or <range> element is less than that defined in the corresponding <position> element then it is assumed to be right justified within the locations defined in the <position> element. Export programs must ensure that any extra columns contain leading blanks or zeros. For example:
Data value
Maximum in <values> element
<position> element
Data record b=space
7
9
start="21" finish="21"
7
7
9
start="21" finish="22"
07 or b7
7
99
start="21" finish="22"
07 or b7
7
99
start="21"
illegal
7
99
start="21" finish="24"
0007 or bbb7
17
99
start="21" finish="22"
17
17
99
start="21" finish="24"
0017 or bb17
142
9999
start="21" finish="24"
0142 or b142
missing
9999
start="21" finish="24"
bbb
7
99
start="4" (.csv format)
7 or 07 or b7
Allocation
If DataFormat is set, set ColCount to Len(longest Value property) or CodeWidth (whichever is wider). If Value properties are not set, they are created from ColOffset and Punch.
There could be a combination of Values set and Values derived from ColOffset and Punch.
Possible errors
CodeWidth < Len(longest Value properties)) – If Value properties are not set, they are created from ColOffset and Punch.
ColCount < CodeWidth
Literal strings
Data is recorded as characters (even if the code is numeric) as described by the <values> element. The literal codes are case-sensitive and might contain blanks.
The data field length is derived from the <value> elements contained within the <values> element, and is the minimum number of characters required to represent the longest literal. If a particular data value requires less than the maximum for the field, it should be left justified using space characters as padding.
If the data field length from the <value> element is less than that defined in the corresponding <position> element then it is assumed to be left justified within the locations defined in the <position> element. Export programs must ensure that any extra columns contain blanks.
In a .csv data file, any literal value with embedded commas, or leading/trailing spaces, must be delimited with double-quote characters. For example:
Data value
Maximum in <values> element
<position> element
Data record b=space
A
1
start="21" finish="21"
A
A
1
start="21" finish="22"
Ab
A
2
start="21" finish="22"
Ab
A
2
start="21"
illegal
A
2
start="21" finish="24"
Abbb
ZZ
2
start="21" finish="22"
ZZ
ZZ
2
start="21" finish="24"
ZZbb
missing
4
start="21" finish="24"
Bbbb
A
1
start="4" (.csv format)
A or "A"
A
2
start="4" (.csv format)
A or "A" or "A "
Allocation
If DataFormat is set, set CodeWidth and ColCount to Len(longest Value property). If Value properties are not set, they are created from ColOffset and Punch.
There could be a combination of Values set and Values derived from ColOffset and Punch.
Possible errors
DataFormat set to Literal but no CodeWidth set
CodeWidth < Len(longest Value property) - If Value properties are not set, they are created from ColOffset and Punch.
ColCount < CodeWidth
Variables of type Multiple
Data for Multiples can be recorded as either one character per value (bitstring format), or as a list of values (categorical format).
Bitstring format
Data is recorded with one character per category of the corresponding variable. A character '1' is used to signify that a category has been selected, a character '0' signifies that a category is not selected. The category value refers to the relative position of the 0/1 code in the data field; a category value of 9 will always refer to the code in the 9th location of the data field even if some lower category values have not been defined. An import program should ignore the locations of undefined category values.
The data field length is the highest category value in the associated <value> or <range> elements. If the data field length is less than the <position> element, then it is assumed to be left justified within the locations defined by the position. Export programs should ensure that any extra columns contain blanks or zeros.
In a .csv data file any data field representing a bit-style multiple, which begins with '0' (zero), should always be delimited with double-quote characters. For example:
Data value
Maximum in <values> element
<position> element
Data record b=space
1
1 to 9
start="21" finish="29"
100000000
1
1, 2, ,3, and 9
start="21" finish="29"
100xxxxx0
1, 3
1 to 12
start="21" finish="32"
101000000000
none
1 to 99
start="21" finish="120"
000000000...0
2, 8
1 to 9
start="21" finish="30"
010000010b or 0100000100
2
1, 2, 3, and 9
start="21" finish="24"
illegal
missing
1 to 9
start="21" finish="29"
bbbbbbbbb
missing
1, 2, 3, and 10
start="21" finish="30"
bbbxxxxxxb
1
1 to 9
start="5" (.csv format)
100000000 or "100000000"
2, 8
1 to 9
start="4" (.csv format)
"010000010"
Allocation
Allocate like explode MultiPunch.
Use ColOffset as Value if Value does not exist when writing.
Possible errors
CodeWidth not required?
<largest ColOffset – in this case Values should be read as ColOffsets.
Categorical format
Data is recorded as a series of sub-fields, each containing one category value of the variable. The category value is recorded as an integer number as described in the <values> element. The number 0 should be used to represent sub-fields that are not needed.
The data sub-field length is the minimum number of characters required to represent the largest value in the values block. Thus variables with values up to 9 have a data sub-field one character long, variables with values up to 99 have a data sub-field length of 2, and so on. If any particular data value requires less than the maximum for the sub-field, it should be right justified using leading space or zero characters as padding.
Data values can be stored in any or all sub-fields. If the data sub-field length is less than the sub-field defined in the <categorical> element then it is assumed to be right justified within the width defined in the categorical. Export programs must ensure that extra columns contain blanks or zeros within the sub-fields.
If the total width of the sub-fields is less than that defined in the <position> element then the sub-fields are stored consecutively left-justified within the locations defined by the position. Export programs must ensure that any extra columns contain blanks or zeros. For example:
Data value
Maximum in <values> element
<categorical> element
<position> element
Data record b=space
1
1 to 9
subfields="2" width="1"
start="21" finish="22"
10 or 01
1
1, 2, ,3, and 9
subfields="2" width="1"
start="21" finish="22"
10 or 01
1, 3
1 to 9
subfields="2" width="1"
start="21" finish="22"
13
1
1 to 9
subfields="2" width="21"
start="21" finish="24"
b1b0 or b0b1 or 0100 an so on
none
1 to 9
subfields="2" width="1"
start="21" finish="22"
00
2
1, 2, 3, and 9
subfields="2" width="1"
start="21" finish="24"
20bb or 02bb or 2000 and so on
1, 42
1 to 999
subfields="2" width="3"
start="21" finish="26"
001042
missing
1 to 999
subfields="2" width="3"
start="21" finish="36"
bbbbbb
1
1 to 9
subfields="2" width="1"
start="4" (.csv format)
1 or 10 or "10" or "01"
1
1 to 99
subfields="2" width="2"
start="4" (.csv format)
"0100" or "0001"
Allocation
If DataFormat is set, set CodeWidth to Len(longest of the Value properties). If Value properties are not set, they are created from ColOffset and Punch
Set ColCount = CodeWidth*EffMax
There could be a combination of Values set and Values derived from ColOffset and Punch.
Possible errors
CodeWidth not set
CodeWidth < Len(longest of the Value properties)
ColCount< CodeWidth*EffMax
See also
Metadata Model to Quantum