Examples of Records Written

The following examples illustrate how compilers and preprocessors communicate with the Application Development Manager/400 APIs in different circumstances. In all these examples, assume that the compiles are submitted by an Application Development Manager/400 BLDPART command, which means it has called QLYSETS to set the status of the space to *READY before calling the compiler or preprocessor.

It is also assumed that a cleanup is done after the compile by calling QLYSETS again to set the status of the space to *COMPLETE.

Example 1

RPG/400® compiler successfully compiles source that has one include in it.

The compiler first calls QLYGETS and determines that it was started by the BLDPART command. Then it calls QLYWRTBI to pass records of the following record types and in the following order:

  1. Processor member start
  2. Include
  3. Normal processor end

Example 2

DDS compiler successfully compiles source of type LF and creates a logical file based on two physical files.

The compiler first calls QLYGETS and determines that it was started by the BLDPART command. Then it calls QLYWRTBI to pass records of the following record types and in the following order:

  1. Processor member start
  2. File reference

    This record is called for the first physical file on which the logical file is based. The based-on indicator is set to Y (yes).

  3. File reference

    This record is called for the second physical file on which the logical file is based. The based-on indicator is set to Y (yes).

  4. Normal processor end

Example 3

COBOL/400® compiler fails when compiling source that has one include in it because the include was not found in *LIBL.

The compiler first calls QLYGETS and determines that it was started by a BLDPART command. Then it calls QLYWRTBI to pass records of the following record types and in the following order:

  1. Processor member start
  2. Abnormal processor end

Example 4

COBOL/400 compiler fails when compiling source that references a record format of a database file because the file was not found in *LIBL.

The compiler first calls QLYGETS and determines that it was started by a BLDPART command. Then it calls QLYWRTBI to pass records of the following record types and in the following order:

  1. Processor member start
  2. External reference error

    The name of the Library specified passed to QLYWRTBI is *LIBL.

  3. Abnormal processor end

Example 5

ILE C CRTBNDC compiler successfully compiles a *PGM from a source that has one include in it.

The compiler calls QLYGETS and determines that it was started by the BLDPART command. Then it calls QLYWRTBI to pass records of the following record types and in the following order:

  1. Processor member start
  2. Include
  3. Normal processor end call next
  4. Processor object start
  5. Normal processor end

Note: The Processor object start and the Normal processor end records are written by the CRTPGM processor internally called by the CRTBNDC compiler.

Example 6

CRTPGM binder successfully binds objects from 2 modules, and references a bind directory and a service program.

The compiler calls QLYGETS and determines that it was started by the BLDPART command. Then it calls QLYWRTBI to pass records of the following record types and in the following order:

  1. Processor object start
  2. Module reference
  3. Module reference
  4. Bind directory reference
  5. Service program reference
  6. Normal processor end.

[ Back to top | High-level Language APIs | APIs by category ]