Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Defining a client

A program or method that requests services from one or more methods in a class is called a client of that class.

In a COBOL or Java client, you can:

In a COBOL client, you can also call services provided by the Java Native Interface (JNI).

A COBOL client program consists of the usual four divisions:

Table 52. Structure of COBOL clients
Division Purpose Syntax
IDENTIFICATION (required) Name a client. Code as usual, except that a client program must be:
  • Thread-enabled (compiled with the THREAD option, and conforming to the coding guidelines for threaded applications)
ENVIRONMENT (required) Describe the computing environment. Relate class-names used in the client to the corresponding external class-names known outside the compilation unit. CONFIGURATION SECTION (required)
REPOSITORY paragraph for defining a client (required)
DATA (optional) Describe the data that the client needs. DATA DIVISION for defining a client (optional)
PROCEDURE (optional) Create instances of classes, manipulate object reference data items, and invoke methods. Code using INVOKE, IF, and SET statements.

Example: defining a client

related tasks
Compiling, linking, and running OO applications
Preparing COBOL programs for multithreading
Communicating with Java methods
Coding interoperable data types in COBOL and Java
Creating and initializing instances of classes
Comparing and setting object references
Invoking methods (INVOKE)
Invoking factory or static methods

related references
THREAD


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)