uCosminexus Service Platform, Basic Development Guide

[Contents][Glossary][Index][Back][Next]

4.4.1 Data types and character code types in the binary format definition file

In the binary format definition editor, you can use the following data types to define the formats:

For details on types of character codes to be handled in each data, see "1.3.2 Simple content element dialog" in "Service Platform Reference Guide".

The following points describe the details for each data type:

Organization of this subsection
(1) Numeric value
(2) Character string
(3) Bytes string
(4) Bit string
(5) Date and time

(1) Numeric value

Numeric value type is divided in character string type numeric value and byte string type numeric value depending on the numeric value attribute. Numeric value attributes depending on the respective numeric value types are as follows:

Character string type numeric value
  • Integer
  • Real number
  • Numeric value with fixed decimal part

Description about procedure to transform from binary type to XML type is as follows.

Description about transformation specifications from XML type to binary type is as follows.

Byte column type numeric value
  • Zone format numeric value
  • Pack format numeric value
  • Coded binary integer
  • Unsigned binary integer

You can omit the coding of character string type numeric value. Coding expression position is before the numeric character string. If not even one number is expressed in input data, 0 is considered. Also, you can use 0 or space in embedded character.

All numeric value attributes are treated as decimal, in the data transformation. Maximum number of digits (total of digits in integer part and fraction part) is 34.

When you perform the XML transformation for character string numeric value type, transformation to decimal type of the XML schema is performed. When you perform XML transformation for the bytes string type numeric value, transformation to decimal type of XML schema is performed in the case of zone format numeric value and pack format numeric value and transformation to integer type is performed in the case of singed binary integer and unsigned binary integer.

Respective numeric value attributes are explained as follows:

(a) Integer

This numeric value attribute is configured by "Numeric value" and "Symbol". This numeric value attribute is internally processed in BigIntegerr class.

Integer has maximum 34 digits and does not include the fraction part.

Examples of integer are as follows:

(Example 1)
1234567890

(Example 2)
-1234567890
(b) Real number

This is general format numeric value attribute configured by "Number", "Symbol" and "Decimal point". This numeric value attribute is internally processed in BigDecimal class.

Real number has maximum 34 digits and includes fraction part. However, when input data does not have a number and has only fraction part, error occurs.

Examples of real number are as follows:

(Example 1)
1234567890

(Example 2)
-123.456
(c) Fixed fraction numeric value

Fixed fraction numeric value is a numeric value attribute, which is configured from "Symbols" and "Numbers". For this attribute, if you specify digits in fraction part, decimal point is implicitly set. This numeric value attribute is internally processed in BigDecimal class.

Fixed fraction part numeric value has maximum 34 digits and fraction part is of maximum 33 digits.

Examples of fixed fraction part numeric value when you specify 4 digits for fraction part are as follows:

(Example 1) For "1234567890"
123456.789
(1234567890 --> 123456.7890 --> 123456.789)

(Example 2) For "+123"
0.0123
(+123 --> +0.0123 --> 0.0123)

(Example 3) For "-1230000"
-123
(-1230000 --> -123.0000 --> -123)
(d) Zone format numeric value

Zone format numeric value is numeric value attribute of zone format. When you specify digits of fraction part, decimal point is implicitly set. This numeric value attribute is internally processed in BigDecimal class.

Zone format numeric value has maximum 34 digits and symbol is expressed in zone part of last byte in the item.

When character code is JIS8, plus symbol is expressed by 0x3 and minus symbols is expressed by 0x7.

When character code is EBCDIK, plus symbols is expressed by 0xC and 0xF, minus symbols is expressed by 0xD.

You can change type plus or minus of the sign.

Zone part other than final byte is expressed with plus sign of each code and numeric value is expressed by last 4 bits of each byte (0x0~0x9).

Examples of zone format numeric value when character code is JIS8, are as follows:.

(Example 1) For "0x31323334" (no specification of fraction part)
1234

(Example 2) For "0x31323334" (when you specify fraction part to 2 digits)
12.34

(Example 3) For "0x31323374" (no specification of fraction part)
-1234
(e) Pack format numeric value

This is pack format numeric value attribute. If you specify digits in fraction part, the decimal point is implicitly set. This numeric value attribute is internally processed in BigDecimal class.

Pack format numeric value has maximum 34 digits and when digits count is odd number, the first 4 bits of the topmost byte have to be set to 0.

Symbols are expressed with last 4 bits of the final byte of item data. Plus symbol is expressed with 0xC or 0xF, minus symbol is expressed with 0xD and numeric value is expressed in 4 bits (0x0~0x9). You can change plus or minus of the symbol. For data transformation, 0xC is output as plus symbol.

Examples of pack format numeric value when character code is JIS8 are as follows:

(Example 1) For "0x01234F" (no specification of fraction part)
1234

(Example 2) For "0x01234F" (you specified the fraction part to 2 digits)
12.34

(Example 3) For "0x01234D" (no specification of fraction part)
-1234
(f) Signed binary integer

This is numeric value attribute configured with signed binary integer having bytes in the range of 1~8 bytes. This numeric value attribute is internally processed in BigInteger class.

Endian depends on the format information.

Examples of singed binary integer in case of Big Endian are as follows:

(Example 1) For "256"
0x0100

(Example 2) For "-257"
0xFEFF
(g) Unsigned binary integer

This is numeric value attribute configured with unsigned binary integer having bytes in the range of 1~8 bytes.

Endian depends on the format information.

Examples of unsinged binary integer in case of Big Endian are as follows:

(Example 1) For "-256"
0x0100

(Example 2) For "65279"
0xFEFF

(2) Character string

This section describes specifications for transforming from binary type to XML type.

Specifications to transform from XML type to binary type are explained as follows:

(3) Bytes string

Byte string is the byte string saved between platforms in bit pattern. When transforming byte string to XML, it is transformed to the hexBinary type or base64Binary type of XML schema.

In hexBinary type, the 8 bit (1 byte) binary data is transformed to the hexadecimal binary characters. For example, when expressing the source data having 300 bytes, in hexBinary type, 300 bytes x 2 characters (600 characters) are required.

In base64Binary type, 6 bit (6/8 byte) binary data is transformed to 1 digit character encoded as Base64. For example, to express the source data of 300 bytes, in base64Binary type, 300 x 8/6 characters (400 characters) are required.

(4) Bit string

Bit string is a string in which bits expressed in binary are aligned. Bit string type is the data type that allows user to handle the binary data in 1 digit unit. Bit string type is processed in Big Endian.

Figure 4-5 Images of bit string and bit string type

[Figure]

Transformation from binary type to XML type is performed as follows:

Transformation from XML type to binary type is performed as follows:

(5) Date and time

Date and time is the type configured by combination of parts like Year, Month, Date, Hours, Minutes and Seconds. You can specify numeric value for individual part and part that expresses seconds can include a fraction part.

When transforming the date and time type from XML type to fixed length element of binary type, if the size of input XML after transformation is smaller than the size of fixed length element, you can specify whether to express by aligning the element data to either left or right side (left or right justification).

Limitations for specifying the date and time type are as follows:

Following table describes parts of date and time type.

Table 4-1 Parts of the date and time type

Parts Meaning Number of specification digits
CCYY Christian year (0~9999) 1~4 digits
YY Year (last 2 digits of Christian year) Maximum 2 digits
MM Month (1~12) Maximum 2 digits
DD Date (1~31) Maximum 2 digits
hh Hour (0~23) Maximum 2 digits
mm Minutes (0~59) Maximum 2 digits
ss Seconds (0~59, fraction part can be included) Maximum 2 digits in integer part and maximum 3 digits in fraction part

You can specify 3 data types (date type, time type and date and time type), depending on the combination of parts.

Following table shows the combination of data type and part.

Table 4-2 Combination of data type and part

Data type Combination Meaning
Date type CCYYMMDD Christian year/month/date
YYMMDD# Last 2 digits in Christian year/month/date
Time type Hhmmss Hour/minutes/second
Date and time type CCYYMMDDhhmmss Christian year/month/date/hour/minutes/second
YYMMDDhhmmss Last 2 digits of Christian year/month/date/hour/minutes/second

Note#
In case of "YYMMDD" format of date type, the range you can specify is Year 1951~Year 2050, as per the Christian year calculation.

When transforming date type, time type and date and time type to XML, the respective types are transformed as follows:

Examples of date and time type are as follows:

(Example 1) For January 24, 2001
20010124

(Example 2) For December 31, 1999, 1:30:59
991231013059