Selecting the High-Level Language To Use
You can use APIs with all the languages available on AS/400 business computing
systems, except for the ILE APIs. ILE APIs that are implemented as service pro-
grams (*SRVPGM) can be accessed only by ILE languages. In some cases, a
program (*PGM) interface is provided so that non-ILE languages can access the
function.
Some APIs also require that particular data types and particular parameter passing
conventions be used. Figure 2-2 shows the languages available on the AS/400
system and the data types that they provide.
Figure 2-2. Language Selection Considerations — Data Types
Language
1
Poin-
ters
Binary
2
Binary
4
Char-
acter
Zoned
Decimal
Packed
Decimal
Float-
ing
Point
Struc-
tures
Single
Array
Excep-
tion
Han-
dling
BASIC (PRPQ
5799-FPK)
X X X X
2
X
2
X X X
ILE C X X X X X
9
X X X X
VisualAge C++ for
OS/400
X X X X X
10
X X X X
CL X
3
X
3
X X X
4
X
4
X
ILE CL X
5
X
3
X
3
X X X
4
X
4
X
COBOL X X X X X X X X X
6
ILE COBOL X X X X X X X X X
6
MI X X X X X X X X X X
Pascal (PRPQ
5799-FRJ)
X X X X X
7
X
7
X X X X
PL/I (PRPQ
5799-FPJ)
X X X X X X X X X X
REXX X X
4
X
4
X
RPG X X X X X X X X
8
ILE RPG X X X X X X X X X
8
Notes:
1
You cannot develop Cross System Product (CSP) programs on an AS/400 system. However, you can develop CSP pro-
grams on a System/370 system and run them on your AS/400 system.
2
Refer to the CNVRT$ intrinsic function.
3
There is no direct support, but the %BIN function exists on the Change Variable (CHGVAR) CL command to convert to and
from binary.
4
There is no direct support, but you can use the substring capability to simulate structures and arrays.
5
There is no direct support, but pointers passed to a CL program are preserved.
6
COBOL and ILE COBOL programs cannot monitor for specific messages, but these programs can define an error handler to
run when a program ends because of an error.
7
There is no direct support, but you can use extended program model (EPM) conversion routines to convert to and from
zoned and packed decimal.
8
RPG programs cannot monitor for specific messages, but these programs turn on an error indicator when a called program
ends with an error. These programs can define an error handler to run when a program ends because of an error.
9
Packed decimal is implemented in ILE C with the decimal() data type.
10
Packed decimal is implemented in VisualAge C++ for OS/400 with the Binary Coded Decimal (BCD) class. The BCD class is
the C++ implementation of the C-language's decimal(). The BCD object can be used in API calls because it is binary com-
patible with the decimal() data type.
Chapter 2. Getting Started with APIs 2-3