Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


Example: defining a class

The following example shows a first attempt at the definition of the Account class, excluding method definitions.

 cbl dll,thread,pgmname(longmixed)
 Identification Division.
 Class-id. Account inherits Base.
 Environment Division.
 Configuration section.
 Repository.
     Class Base    is "java.lang.Object"
     Class Account is "Account".
*
 Identification division.
 Object.
  Data division.
  Working-storage section.
  01 AccountNumber  pic 9(6).
  01 AccountBalance pic S9(9) value zero.
*
  Procedure Division.
*
*   (Instance method definitions here)
*
 End Object.
*
 End class Account.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)