Defining an item Schema DDL
58 U929-J-Z125-9-76
4.2.2 Defining a packed numeric item [level-number ]item-name TYPE IS FIXED REAL DECIMAL
[ integer-1[,integer-2]].
Packed items can contain numeric values only. They are exclusively used as computational
items by the database programmer and cannot be printed without prior editing by a DML
program. Packed items require less storage space and can be processed faster than
unpacked items.
level-number denotes whether the item is part of a repeating group:
If the item is not to be part of a repeating group, the specified level number should be the
smallest level number in the whole record type.
This is especially important if the item is to be used as a key item.
If the item is to be part of a repeating group, proceed as descr ibed on page 66.
item-name specifies the name assigned by the user.
integer-1 and integer-2 are used to describe the value range of an item, where
–integer-1 indicates the number of storage locations the item contains, the maximum
being 18. Each storage location can be filled with a d ecimal digit.
Default value for integer-1: 18
–integer-2 specifies the position of the decimal point. This has no effect on the number of
storage locations, however. If integer-2 is positive, it denotes the number of digits to the
right of the decimal point; if it is negative, it signals to UDS/SQL h ow many zeros it is to
append to the item contents when performing calculations.
It follows that if integer-2 is m, specification of integer-2 means a multiplication of the item
contents by 10-m.
Default value for integer-2: 0
If at least one of the following assertions applies to an un packed numeric item, the item
cannot be accessed using SQL, nor can any new records of the recor d type involved be
inserted:
– number of bytes of storage > 15
– scale factor < 0
– scale factor > number of bytes of storage
A positive scale factor specifies the number of digits to the right of the decimal poin t, while
a negative scale factor specifies how many zeroes UDS/SQL must append to the item
contents when performing calculations.