Chapter 3 Working with the AI Component Builder


Supported Datatypes

This section covers the following topics:

COBOL FILLER and Group Level Items

Fields declared as FILLER in the COBOL COMMAREA definition are not displayed as fields in the component, and the corresponding storage is allocated but inaccessible to the component user.

Also, AI for CICS only displays information about elementary fields in the component. Group-level items are not displayed.

COBOL Datatype Support

The AI for CICS Component Builder supports the following datatypes in the COMMAREA.

Table 3-4: Supported COBOL datatypes in the COMMAREA

COBOL Datatype

Picture Clause

Java Datatype

Jaguar IDL Datatype

Character Data

PIC X(n) or PIC A(n)

java.lang.string

string

Numeric Display

PIC S9(n), or PIC S9(n)V9(n)

See Table 3-6.

Numeric Binary

PIC S9(n) COMP

SeeTable 3-6.

Numeric Packed

PIC S9(n) COMP-3, or
PIC S9(n)V9(n) COMP-3

See Table 3-6.

Note   The AI for CICS Component Builder does not support COBOL fields defined as USAGE COMP-1, USAGE COMP-2, or PIC G.

Additional Datatype Information

This section describes the default datatypes that AI for CICS maps based on the COBOL datatype.

This section covers the following topics:

When the Component Builder parses a COBOL COMMAREA data definition, it maps the COBOL datatypes to datatypes used by AI for CICS and Jaguar.

In the Component Builder, you can change the datatype that the parser determined to binary. When binary is selected as the Jaguar datatype, the AI Adapter does not perform conversion to or from the format of the underlying COBOL storage datatype. Instead, this field is treated as raw data that the client application programmer must interpret and format correctly. However, the AI Adapter will throw an exception if the length of the byte array passed as an input parameter exceeds the length of the underlying COBOL storage. If the array length of an input parameter is less than the underlying COBOL storage, only the number of bytes in the array are placed into the storage for that field.

Alphanumeric Datatypes

Alphanumeric datatypes (PICTURE X(n)) are subject to character set conversion, such as ASCII to EBCDIC, using the code page indicated on the component's associated connection definition. Keep the following in mind:

Alphabetic Datatypes

Alphabetic datatypes (PICTURE A(n)) are treated the same as alphanumeric datatypes. AI for CICS does not verify that valid alphabetic characters are stored in these fields.

Keep the following in mind:

Numeric Datatypes

AI for CICS supports numeric datatypes as follows:

Table 3-5: Numeric datatypes and COBOL USAGE clauses

Numeric Datatype

COBOL USAGE Clauses

Binary

  • COMP
  • COMPUTATIONAL
  • BINARY

Packed Decimal

  • COMP-3
  • COMPUTATIONAL-3
  • PACKED-DECIMAL

Zoned Decimal

DISPLAY

As shown in Table 3-6, all formats of default and allowable Java datatypes depend on precision (total number of digits in PIC clause) and scale (number of digits to the right of the decimal).

Table 3-6: Numeric datatype mappings according to precision and scale

Precision

Scale

Default Java Datatype

Jaguar IDL Datatypes

1 - 4

0

short

integer<16>

5 - 9

0

int

integer<32>

10 - 18

0

long

integer<64>

any

> 0

java.math.BigDecimal

decimal

Input and Output Parameter Information

Following are additional points to consider:

 


Copyright © 1999 Sybase, Inc. All rights reserved.