EGL Reference Guide for iSeries

Relative efficiency of different numeric types

EGL supports the types DECIMAL, NUM, NUMC, and PACF so you can work more easily with files and databases that are used by legacy applications. It is recommended that you use items of type BIN in new development or that you use an equivalent integer type (BIGINT, INT, or SMALLINT); calculations are most efficient with items of those types. You get the greatest efficiency by using items of type BIN, length 2, and no decimal places (the equivalent of type SMALLINT).

In calculations, assignments, and comparisons, items that are of type NUM and have no decimal places are more efficient than items that are of type NUM and have decimal places.

For code generated in Java, calculations with items of types DECIMAL, NUM, NUMC, and PACF are equally efficient. For code generated in COBOL, however, these distinctions apply:


Related concepts
DataItem part
Record parts
References to variables and constants
Structure


Related reference
Assignments
BIN and the integer types
call
CHAR
DBCHAR
DECIMAL
Exception handling
Function invocations
HEX
Items
Logical expressions
MBCHAR
NUM
NUMC
Numeric expressions
Operators and precedence
PACF
SQL item properties
String expressions
UNICODE


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]