Data Item Defaults

Simple data items are modeled as described in the following table.

Enterprise Database Server Data Item Type

SQL Column Type

Notes

AGGREGATE(i)

Numeric(i)

Read-only

AGGREGATE(I,j)

Numeric(i,j)

Read-only

AGGREGATE(Si)

Numeric(i)

Read-only

AGGREGATE(Si,j)

Numeric(i,j)

Read-only

ALPHA(n)

Character(n) of EBCDIC

When used with USAGE EBCDIC, the ALPHA data items with a specified ccsversion are type CHAR based on the specified ccsversion.

ALPHA(n)

Character(n) varying

When used with SIZE VARYING WITH, the ALPHA data items with a specified ccsversion are type CHAR based on the specified ccsversion.

BOOLEAN

Integer

Never null.

COUNT

Integer

Read-only

DATE

Date

Presented or accepted as YYYY/MM/DD

FIELD(n), n <= 39

Integer

Defines an inherent verification, which is reflected in the schema, from the size of FIELD data items. For example, a FIELD(4) data item is capable of holding only the numbers 0 to 15. Relational Design Center automatically defines a verify condition for the data item that checks that the value assigned to the data item falls between 0 and 15, inclusive.

FIELD(n), n > 39

Real

FIELD data items do not support a true REAL type; therefore, they are READONLY.

FIELD of n BOOLEANS

n integers

Never null.

FILLER

Not modeled

 

GROUP

Not separately modeled unless occurring

 

INTERNAL BLOB or CLOB

Longvar binary locator or Longvar character locator

Read-only

NUMBER(i)

Numeric(i)

Always signed.

NUMBER(i,j)

Numeric(i,j)

Always signed.

NUMBER(Si)

Numeric(i)

Always signed.

NUMBER(Si,j)

Numeric(i,j)

Always signed.

POPULATION

Integer

Read-only

REAL

Real

REAL(p, s) and REAL(p)

Numeric(p, s)

This is an unsigned, scaled, binary integer in the DASDL database. MCPSQL treats REAL(p, 0) exactly like REAL(p). There is no exact SQL mapping; MCPSQL will generally treat this as a NUMERIC(p, s), subject to notes (1), (2), (3), and (4).

REAL(S11)

Integer

This is a signed binary integer in the DASDL database. MCPSQL treats REAL(S11) exactly as an INTEGER without additional restrictions.

REAL(Sp, s)

Numeric(p, s)

This is a scaled binary integer in the DASDL database. MCPSQL treats REAL(Sp, 0) exactly like REAL(Sp). Otherwise MCPSQL will treat this as a NUMERIC(p, s), subject to notes (2), (3), and (4).

RECORD SERIAL NUMBER

Real

This data type is only modeled if the record serial number (RSN) is explicitly declared in the DASDL.

Read-only

RECORD TYPE

Integer

TIME

Time

Presented or accepted as HH:MM:SS.ss. Internally stored as 100th of a second since midnight.

Notes:
  1. There is no exact mapping in SQL for unsigned data items. However, MCPSQL will preserve the unsigned attribute. All negative values stored by INSERT or UPDATE queries will be made positive (the negative sign will be discarded), per DASDL specification and COBOL and ALGOL tradition.

  2. If precision 'p' has the value 11, a full INTEGER value can be stored (after scaling by 's' when applicable). Otherwise, MCPSQL will enforce compliance with the precision defined in DASDL and report a truncation error for data values stored using INSERT or UPDATE queries which exceeds the specified range.

  3. MCPSQL will use the full value stored in the database (de-scaled by scale 's' when appropriate) for all calculations, comparisons and output (effectively ignoring the precision 'p' specification). Values that exceed the range implied by the 'p' precision can only be stored into the database by software other than MCPSQL. See note (2).

  4. Data items specified as REAL(p, s) and REAL(Sp, s) are output as NUMERIC(12, s) values.

The data item options REQUIRED and INITIALVALUE are modeled in SQL as NOT NULL and DEFAULT column constraints, respectively.