High-Level Language APIs

These APIs communicate with compilers, and the DB2 for AS/400 SQL and COBOL/400 languages.
This section includes:

Application Development Manager/400 APIs

The Application Development Manager/400 APIs allow a control language (CL) command such as the Build Part command (BLDPART) to determine, for example, the includes and external references that were used by certain processors when processing a source member. The term processor is used in these APIs to mean compiler or preprocessor.

In Application Development Manager/400 terms, a part can be either a source member or an object, such as a file. Refer to the appropriate Application Development Manager/400 publication, as listed in the bibliography, for more information.

If you have an application that can use the information provided by the APIs, you can call these APIs from any high-level programming language. The Application Development Manager/400 feature does not need to be installed on your system for you to use these APIs.

There are four APIs presented:

The Get and Set Status APIs are used to query and initialize the build information space that is to contain the Application Development Manager/400 information. The Write and Read Build Information APIs are used to write or read records of build information to and from the space.

There are several different types of records that can be read or written using the Application Development Manager/400 APIs. These record types are explained in Record Types. For more information, see the Examples of Records Written section.

The following compilers and preprocessors use these APIs.

Table 1. Compilers and preprocessors that can be used with the Application Development Manager/400 feature
Compiler/
Preprocessor
Language

Compiler/Preprocessor OS/400 Command Supported if *PRV is Specified for Target Release
RPG/400 CRTRPGPGM Yes
ILE RPG/400 No
COBOL/400 CRTCBLPGM Yes
ILE COBOL/400 No
ILE CL No
ILE C Yes
CRTPF, CRTLF, CRTDSPF, CRTPRTF, CRTICFF Not applicable
CL CRTCLPGM Yes
CLD CRTCLD Yes
CMD CRTCMD Not applicable
CRTSQLRPG, CRTSQLCBL, CRTSQLCI Yes
CRTSQLRPGI, CRTSQLCBLI No
CRTSRVPGM CRTSRVPGM Yes
CRTPGM CRTPGM Yes
MENU CRTMNU TYPE(*UIM) Not applicable
PNLGRP CRTPNLGRP Not applicable
Notes:

  1. Default command is used by the BLDPART command.

  2. Appropriate default compiler command is used based on the part type and the language.

The following diagram shows the proper usage and order in which the APIs should be called.

Figure 1. Overall Application Development Manager/400 API Usage


Overall Application Development Manager/400 API Usage.


QLYGETS should be called by the application or compiler before calling the other three APIs: QLYSETS, QLYWRTBI, and QLYRDBI to verify that the space is available for use.

The following table describes the API space status values that can be received by calling the QLYGETS API, and the action that should be taken by the application or compiler that is calling the API.

Table 2. API Space Status
Status Application Compiler
*COMPLETE The space is available for use. Call QLYSETS to set to *READY. Do not write API records.
*NONE The space does not exist. The application calls QLYSETS to create and set the space to *READY. Do not write API records.
*READY The space is in use by a compiler. The other APIs should not be called. The space is available for writing.

Compilers use the APIs to write to the space. Applications use the APIs to read from the space.

Note: Unpredictable results can occur when the APIs are not properly used or are used in the incorrect order.

Calling multiple API-supporting compilers simultaneously in a single interactive session (one possible way of doing this is by pressing the Attention key and then command key F9 to get to the command line) may cause unpredictable results. The compiler can fail, for example, or incorrect or incomplete information can be put in the work space.


Top | COBOL/400 APIs | Examples of Records Written
Record Types | APIs by category

[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]