Skip to main content
Omnitracs Knowledge Base

Supported Data Types

Supported Data Types

The QTRACS/400 API suite uses the data types in the table below to pass parameters. A more detailed description of each data type follows the table.

Data Type As Shown on API Where, n= Where, d=
Character Char( n ) Num of characters/bytes N/A
Packed Decimal Packed (n,d) Num of digits Num of decimal places
Zoned Decimal Zoned(n,d) Num of digits Num of decimal places
Integer Integer( n ) Num of bytes N/A

Character Format: The character data type is defined as a fixed-length field containing characters stored in EBCDIC format.

Packed Decimal Format: The packed decimal data type is used for numeric data. Packed decimal format means that each byte of storage except for the low-order byte can contain two decimal numbers. Each byte is divided into two 4-bit nibbles. The low-order byte contains the least significant digit of the number in the high-order nibble and a 4-bit sign code in the low order nibble. The 4-bit value will be 1111 (0xF) if the number is a positive number or 1101 (0xD) if the number is a negative number.

Negative Packed(7,0):

Numeric   -143549   signpointer.png
Hex 0 1 4 3 5 4 9 D
Binary 0000 0001 0100 0011 0101 0100 1001 1101
image002.gif 4 Bytes image003.gif

Positive Packed(5,0):

Numeric   500  
Hex 0 0 5 0 0 F
Binary 0000 0000 0101 0000 0000 1111
image005.gif 3 Bytes image004.gif

Zoned Decimal Format: The zoned decimal data type is used for numeric data. Zoned decimal format means that each byte of storage can contain one digit. Each byte of storage is divided into two portions: a 4-bit zone portion and a 4-bit digit portion. The zone portion of the low order (least significant) byte indicates the sign of the zoned decimal number. The 4-bit value will be 1111 (0xF) if the number is a positive number or 1101 (0xD) if the number is a negative number. Only the zone in the low order byte serves as the sign.

Negative Zoned (6,0):

Numeric     -143549     signpointer.png
Hex F 1 F 4 F 3 F 5 F 4 D 9
Binary 1111 0001 1111 0100 1111 0011 1111 0101 1111 0100 1101 1001
image007.gif 6 Bytes image008.gif

Positive Zoned(4,0):

Numeric   500  
Hex F 0 F 5 F 0 F 0
Binary 1111 0000 1111 0101 1111 0000 1111 0000
image002.gif 4 Bytes image003.gif

Integer Format: Also referred to as Binary format; means that the sign (+ or -) is in the leftmost bit of the leftmost byte, and the integer value is in the remaining bits. Positive numbers have a zero in the sign bit; negative numbers have a one in the sign bit and are in twos complement form.

Negative Integer(4):

Numeric   -143549    
Hex signpointer (1).png F F F D C F 4 3
Binary 1111 1111 1111 1101 1100 1111 0100 0011
image002.gif 4 Bytes image003.gif

Positive Integer(2):

Numeric 500  
Hex 0 1 F 4
Binary 0000 0001 1111 0100
image013.gif 2 Bytes image012.gif

The QTRACS/400 API suite may declare 1-, 2-, 4-, or 8-byte integers. The table below lists each of the integer field lengths and their corresponding range of values.

Data Type High Range Low Range
Integer(1) 256 -256
Integer(2) 32,767 -32,768
Integer(4) 2,147,483,647 -2,147,483,647
Integer(8) 9,223,372,036,854,775,807 -9,223,372,036,854,775,808
  • Was this article helpful?