DataItem part

A DataItem part specializes a primitive data type by assigning it a name and optionally limiting the values that can be assigned to it. For more information, see "Specializing primitive types as DataItem parts."

After you define a data item, you can specify the data item name as the type of a variable in a logic or Record part, a parameter in a function or called program, or a column in a data table. You can use a data item variable anywhere that you can use a variable based on the same primitive data type as the data item. For example, if you create a data item based on the FLOAT primitive type, you can use the data item anywhere you can use a FLOAT.

Syntax

Syntax diagram for a DataItem part
dataItemPartName
Specifies the name of the DataItem.
primitiveType
The primitive type specialized by the DataItem.
length
An integer that contains the length of the DataItem. The value of any variable that is based on the data item includes the specified number of characters or digits. Valid values depend on the primitive type on which the data item is based. For more information, see Primitive data types.
decimals
For some numeric types, you can specify decimals, an integer that represents the number of places to be reserved after the decimal point. Valid values depend on the primitive type on which the data item is based. For more information, see Primitive data types. The decimal point is not stored with the data.
"dateTimeMask"
For DATE, TIME, or TIMESTAMP data items, you can specify "dateTimeMask", which assigns a meaning (such as "year digit") to a given position in the value. The mask is present with the data at run time. See Date/time masks and format specifiers.
"intervalMask"
For INTERVAL data items, you can specify "intervalMask", which assigns a meaning (such as "year digit") to a given position in the value. The mask is present with the data at run time. See Date/time masks and format specifiers.
property
A DataItem property.

Example

The following example shows a DataItem part:
  DataItem MoneyVar
    DECIMAL(9,2)
  end

Feedback