Supported Datatypes

In the Message Definition Editor, when selecting a Data Type property for a field in a message definition, refer to this table. Note that not all datatypes apply to all field properties.

The Length Data Type column indicates datatypes supported by the Length Data Type property of a message definition, explained in Numeric properties.

Field properties

DatatypeLength Data TypeSubproperties

Big Endian 2

yes

Two-byte integer where the bytes are ordered with the leftmost byte being the high order or most significant byte. For example, the hexadecimal number 0x0102 is stored as 01 02, where the number pairs show the hexadecimal values of the nibbles of a byte.

Big Endian 4

yes

Four-byte integer where the bytes are ordered with the leftmost byte being the high order or most significant byte. For example, the hexadecimal number 0x01020304 is stored as 01 02 03 04, where the number pairs show the hexadecimal values of the nibbles of a byte.

Big Swap Endian 2

yes

Two-byte integer where the two bytes are swapped with respect to a Big Endian 2 value. For example, the hexadecimal number 0x0102 is stored as 02 01.

Big Swap Endian 4

yes

Four-byte integer where the two bytes of each word are swapped with respect to a Big Endian 4 value. For example, the hexadecimal number 0x01020304 is stored as 02 01 04 03.

Binary

 

Raw binary data, for example, an audio file.

Custom Date and Time

 

Lets you construct your own date/time mask if no suitable templates exist in the drop-down menus for the Date, Date and Time, and Time datatypes (see below).

Subproperty: Date time format.

Date time format

Enter your own date/time mask by entering format codes.

As you enter the Java time pattern string, the bottom status line of the main Sybase WorkSpace dialog dynamically displays a formatted example date and time.

After you enter a valid date/time mask, it is added to the drop-down menu so you can select it again later without retyping.

Date

 

Lets you select one of several preset date formats.

Alternately, if none of the presets work for the date field in your message, select Custom Date and Time instead, which allows you to manually enter and reuse your own date/time format.

This datatype has the following subproperties:

Date format

Select one of the preset formats from the drop-down menu.

For an explanation of the codes used in the preset date/time formats, see Supported Date and Time Format Codes.

Y2k Cutoff

To specify how a 2-digit year from 00-99 is interpreted as a 4-digit year, enter a number from 0 to 99 inclusive. Any 2-digit year <= the Y2k Cutoff is interpreted as 20XX. Any 2-digit year > the Y2k Cutoff is interpreted as 19XX.

For example, if you enter 75, all 2-digit input dates from 76 to 99 are designated as 1976 to 1999 output dates. All 2-digit input dates from 00 to 75 are designated as 2000 to 2075 output dates.

Date and Time

 

Lets you select one of several preset date/time formats.

Alternately, if none of the presets work for the date/time field in your message, select Custom Date and Time instead, which allows you to manually enter and reuse your own date/time format.

This datatype has the following subproperties:

Date and time format

Select one of the preset formats from the drop-down menu, for example, yyyy-MM-dd HH:mm:ss.

For an explanation of the codes used in the preset date/time formats, see Supported Date and Time Format Codes.

Y2k Cutoff

See Date above.

Decimal

 

Datatype where every third number left of the decimal point can be preceded by a comma or other group separator. The decimal point is represented by a period or other character. The actual separator characters are determined by your locale. Numbers right of the decimal point represent a fraction of one unit. For example, the number 12,345.678 is parsed as 12345.678.

Double

 

Double-precision floating point.

Similar to Decimal, except Double datatypes support 64-bit (IEEE 754) values. No commas or other group separators are allowed.

Float

 

Single-precision floating point.

Similar to Decimal, except Float datatypes support 32-bit (IEEE 754) values. No commas or other group separators are allowed.

IBM Packed Decimal

 Integer datatype on larger IBM computers used to represent integers in compact form. Each byte represents two decimal digits, one in each nibble of the byte. The final nibble is always a hexadecimal F. For example, the number 1234 is stored as a 3- byte value: 01 23 4F, where the number pairs show the hexadecimal values of the nibbles of each byte. The number 12345 is stored as a 3-byte value: 12 34 5F. There is no accounting for the sign of a number; all numbers are assumed to be positive.

IBM Signed Packed Decimal

 Packed Integer datatype on larger IBM computers used to represent integers in compact form. This datatype takes into account the sign (positive or negative) of a number. Each byte represents two decimal digits, one in each nibble of the byte. The final nibble is a hexadecimal C if the number is positive, and a hexadecimal D if the number is negative. The following example illustrates how to generate a default value for an IBM Packed Integer: The input datatype is IBM Signed Packed Decimal, with a default ASCII value of -12345. The control is optional and there is no corresponding field in the input message, so Formatter uses the default value, converts it to IBM Signed Packed Decimal, and generates the following output: 12 34 5D. Each pair of numbers represents the two nibbles of a byte. The result is three bytes long.

IBM Signed Zoned Decimal

 Zoned Integer datatype on larger IBM computers used to represent integers. Each decimal digit is represented by a byte. The left nibble of each byte, except the last byte, is a hexadecimal F. The left nibble of the last byte is a hexadecimal C if the number is positive, and a hexadecimal D if the number is negative. The right nibble of each byte is the hexadecimal value of the digit. For example, 1234 is represented as F1 F2 F3 C4, where the number pairs show the hexadecimal values of the nibbles of each byte. -1234 is represented as F1 F2 F3 D4.

IBM Zoned Decimal

 Datatype on larger IBM computers used to represent integers. Each decimal digit is represented by a byte. The left nibble of the byte is a hexadecimal F. The right nibble is the hexadecimal value of the digit. For example, 1234 is represented as F1 F2 F3 F4, where the number pairs show the hexadecimal values of the nibbles of each byte.

Integer

yes

A string of standard ASCII numeric characters, which may be preceded by - (negative).

Integer (Nonnegative)

yes

A string of standard ASCII numeric characters, supporting values >= 0.

Little Endian 2

yes

Two-byte integer where the bytes are ordered with the rightmost byte being the high order or most significant byte. For example, the hexadecimal number 0x0102 is stored as 02 01, where the number pairs show the hexadecimal values of the nibbles of a byte.

Little Endian 4

yes

Four-byte integer where two bytes of each word are swapped with respect to Little Endian 4. For example, the hexadecimal number 0x01020304 is stored as 03 04 01 02.

Little Swap Endian 2

yes

Two-byte integer where the two bytes are swapped with respect to a Little Endian 2 value. For example, the hexadecimal number 0x0102 is stored as 01 02.

Little Swap Endian 4

yes

Four-byte integer where the bytes are ordered with the rightmost byte being the high order or more significant byte. For example, the hexadecimal number 0x0102 is stored as 02 01, where the number pairs show the hexadecimal values of the nibbles as a byte.

String

 A string of character data that is associated with a character set.

Time

 

Based on the international ISO-8601:1988 standard time notation: HHMMSS, where HH represents the number of complete hours passed since midnight (00-23), MM is the number of minutes passed since the start of the hour (00-59), and SS is the number of seconds since the start of the minute (00-59). Times are represented in 24-hour format.Times can be represented in Numeric, String, and EBCDIC base datatypes. For some datatypes, a minimum of four bytes is required.

Note

The EBCDIC datatype should not be used for new applications. It exists only to support previous user formats. If data needs to be encoded in EBCDIC, you must implement one of the supported EBCDIC character sets. For more information on supported character sets, see Supported Character Sets.

Unsigned Big Endian 2

yes

Like Big Endian 2, except that the value is interpreted as an unsigned value.

Unsigned Big Endian 4

yes

Like Big Endian 4, except that the value is interpreted as an unsigned value.

Unsigned Big Swap Endian 2

yes

Like Big Swap Endian 2, except that the value is interpreted as an unsigned value.

Unsigned Big Swap Endian 4

yes

Like Big Swap Endian 4, except that the value is interpreted as an unsigned value.

Unsigned Little Endian 2

yes

Like Little Endian 2, except that the value is interpreted as an unsigned value.

Unsigned Little Endian 4

yes

Like Little Endian 4, except that the value is interpreted as an unsigned value.

Unsigned Little Swap Endian 2

yes

Like Little Swap Endian 2, except that the value is interpreted as an unsigned value.

Unsigned Little Swap Endian 4

yes

Like Little Swap Endian 4, except that the value is interpreted as an unsigned value.

Adding a Field to a Message Definition

Setting Message Definition Preferences

Supported Character Sets

Supported Datatypes for HL7 Messages

Supported Date and Time Format Codes

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com