Importing Procedures to Client Programs

Import Declarations

Import declarations include information such as the name of the imported procedure, the type of procedure, and the library from which it is imported. Declarations of imported procedures must also include parameter specifications for any parameters accepted by the procedure. However, the procedure body (including all local declarations and statements) is omitted. For example, in ALGOL an imported procedure might be declared as follows:

BOOLEAN PROCEDURE X (I);
   INTEGER I;
   LIBRARY LIB1;

Use of Imported Objects

In languages that include library declarations and import declarations, the client program can use imported objects just as if they were local objects of the client program.

COBOL74 Imports

In COBOL74, import objects are not explicitly declared. Instead, when invoking an imported procedure, you can use a special form of the CALL statement that specifies both the name of the procedure and that of the library. If the CALL statement does not explicitly specify a procedure name, the procedure name is assumed as PROCEDUREDIVISION.

Objects That Are Not Imported

In addition to import declarations, the client program can contain declarations of objects that are not imported from libraries.