Developing OTDs for Application Adapters

Non-Root Methods

Every leaf node in a COBOL Copybook OTD represents an elementary item in the Copybook source. For every given leaf node, the OTD provides “getter” and “setter” methods of which the return type and input types depend on the data type and usage type specified in the copybook for the elementary item to which the node corresponds.

For a given non-repeating leaf node named Datum, the following method forms are provided, where T is determined from the follow table.

Table 1–17 Datum Method Forms

Data Types 

Display 

COMP or COMP-4 

COMP-1 

COMP-2 

COMP-3 

COMP-5 

INDEX 

Alphabetic 

For example: 

PIC AAA 

String 

           

Alphanumeric 

For example: 

PIC X9 

String 

 

String 

String 

     

Alphanumeric edited 

For example: 

PIC XB9 

String 

           

Numeric edited 

For example: 

PIC ZZZ99 

String 

           

DBCS 

For example 

PIC GGBGG 

byte[] 

           

External floating point 

For example: 

PIC +9V99E+99 

BigDecimal 

           

Numeric integer (9 digits or less) 

int 

int 

   

int 

 

int 

Numeric floating point 

(COMP-1 or COMP-2 items) 

BigDecimal 

           

Numeric Integer (10 to 18 digits) 

long 

long 

   

long 

long 

 

Numeric integer (19 digits or more) 

BigDecimal 

Big Decimal 

   

Big Decimal 

Big Decimal 

 

For repeating leaf nodes, these two alternative methods are provided:

where i is expected to be a value from 0, representing the ordinal of the desired repetition instance, and where T is determined as previously described.