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 |
|
|
Hex |
0 1 |
4 3 |
5 4 |
9 D |
Binary |
0000 0001 |
0100 0011 |
0101 0100 |
1001 1101 |
4 Bytes |
Positive Packed(5,0):
Numeric |
|
500 |
|
Hex |
0 0 |
5 0 |
0 F |
Binary |
0000 0000 |
0101 0000 |
0000 1111 |
3 Bytes |
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 |
|
|
|
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 |
6 Bytes |
Positive Zoned(4,0):
Numeric |
|
500 |
|
Hex |
F 0 |
F 5 |
F 0 |
F 0 |
Binary |
1111 0000 |
1111 0101 |
1111 0000 |
1111 0000 |
4 Bytes |
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 |
F F |
F D |
C F |
4 3 |
Binary |
1111 1111 |
1111 1101 |
1100 1111 |
0100 0011 |
4 Bytes |
Positive Integer(2):
Numeric |
500 |
|
Hex |
0 1 |
F 4 |
Binary |
0000 0001 |
1111 0100 |
2 Bytes |
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 |