EGL Reference Guide for iSeries
Each EGL primitive type characterizes an area of memory. These
primitive types are of two kinds: character or numeric--
- The character types are as follows:
- CHAR refers to single-byte characters.
- DBCHAR refers to double-byte characters. dbchar replaces
DBCS, which was a primitive type in EGL V5.
- MBCHAR refers to multibyte characters, which are a combination
of single-byte and double-byte characters. mbchar replaces MIX, which
was a primitive type in EGL V5.
- UNICODE refers to double-byte characters that conform to the
UTF-16 encoding standards developed by the Unicode Consortium.
- HEX refers to hexadecimal characters.
- The numeric types are as follows:
- BIGINT refers to an 8-byte area that stores an integer of as
many as 18 digits. This type is equivalent to type BIN, length 8, no
decimal places.
- BIN refers to a binary number.
- DECIMAL refers to packed decimal characters whose sign is
represented by a hexadecimal C (for a positive number) or a hexadecimal D (for
a negative number) in the right half of the rightmost byte. DECIMAL
replaces PACK, which was a primitive type in EGL V5.
- INT refers to an 4-byte area that stores an integer of as many
as 9 digits. This type is equivalent to type BIN, length 4, no decimal
places.
- NUM refers to numeric characters whose sign is represented by a
sign-specific hexadecimal value in the left half of the rightmost byte.
For ASCII, that value is 3 (for a positive number) and 7 (for negative);
for EBCDIC, that value is F (for a positive number) and D (for
negative).
- NUMC refers to numeric characters whose sign is represented by
a sign-specific hexadecimal value in the left half of the rightmost
byte. For ASCII, that value is 3 (for a positive number) and 7 (for
negative); for EBCDIC, that value is F (for a positive number) and C (for
negative).
- PACF refers to packed decimal characters whose sign is
represented by a hexadecimal F (for a positive number) or a hexadecimal D (for
a negative number) in the right half of the rightmost byte.
- SMALLINT refers to an 2-byte area that stores an integer of as
many as 4 digits. This type is equivalent to type BIN, length 2, no
decimal places.
The internal representation of an item of any of the numeric types is the
same as an integer representation, even when you specify a decimal
point. The representation of 12.34 is the same as that of 1234,
for example.
At declaration time, you specify the primitive type that characterizes each
of these values:
- The value returned by a function
- The value in an item, which is an area of memory that is referenced by
name and contains a single value
Other entities also have a primitive type:
- A system item has a primitive type (usually NUM) that is specific to the
item
- A character literal is of one of these types:
- CHAR if the literal includes only single-byte characters
- DBCHAR if the literal includes only double-byte characters from the
double-byte character set
- MBCHAR if the literal includes a combination of single-byte and
double-byte characters
- Character literals of type UNICODE are not supported.
Each primitive type is described on a separate page; and additional
details are available on the pages that cover assignments, logical
expressions, function invocations, and the call statement.
The sections that follow cover these subjects:
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.