CHANGE ATTRIBUTES [ DBChange Plus Technical Addendum for MPE/iX Release 4.0 ] MPE/iX 5.0 Documentation
DBChange Plus Technical Addendum for MPE/iX Release 4.0
CHANGE ATTRIBUTES
Changes the subitem count, type, and/or length of a data item. (For
information about supported item type conversions, refer to Table 3-1
later in this section.)
Syntax
CHA[NGE] A[TTRIBUTES] DataItemName [SubitemCount] SubitemType SubitemLength
Parameters
DataItemName is the name of the data item whose attributes are
changed. Each data item within the database must
have a unique name. This name must be from 1 to 16
characters, the first of which must be alphabetic.
Characters after the first must be chosen from this
set: letters A - Z, digits 0 - 9, and + * / ? ' #
% & @ only.
SubitemCount must be an integer from 1 to 255. For data item type
P, the product of the subitem count and the subitem
length must be evenly divisible by 4. For data item
types U, X, and Z, the product of the subitem count
and the subitem length must equal an even number. If
this parameter is omitted, the subitem count is
assumed to be 1.
SubitemType must be a valid data item type: [!]E, I, J, P, R, U,
X, or Z. Data type E is specified in two ways as
follows:
E Specifies IEEE format for real numbers.
!E Specifies IEEE format when the stored data is
already in IEEE data format. The optional
exclamation point (!) indicates that the data
type is changed to type E; however, the data is
not converted because it is already in the
correct format. To use !E, the current subitem
length must be equivalent to 2 or 4 halfwords.
SubitemLength must be an integer from 1 to 255 for data item types
P, U, X, and Z. The length for types I and J must be
1, 2, or 4. For type K, it must be 1 or 2; and for
types E and R, it must be 2 or 4. For data item type
P, the product of the subitem count and the subitem
length must be evenly divisible by 4. For data item
types U, X, and Z, the subitem count and the subitem
length must be an even number.
____________________________________________________
NOTE When specifying type E with the no-conversion
option (!E), if the subitem length is changed
from 2 to 4, or 4 to 2, the data has to be
converted to fit into the new field size with
the assumption it is already in IEEE format.
____________________________________________________
Description
Use this command to change the subitem count, type, and/or length of a
data item. This command is similar to CHANGE ITEM; however, use the
CHANGE ATTRIBUTE command when you only want to change data item
attributes but do not want to change the security or order in which the
data item appears in the ITEMS part of the schema.
Example
>change attributes store# X 4
In this example, the attributes of the data item STORE# are changed. The
subitem type is changed to X and the subitem length to 4. Because the
SubitemCount parameter is not specified, the subitem count does not
change.
Before the change, the ITEMS part of the schema looks like this:
ITEMS:
ACCOUNT , J2(0,11,12,13,14,18/);
BINNUM , Z2(/13);
CITY , X12(12,13,14,/11);
CREDIT-RATING , R2(/14);
DATE , X6(0,11,12,13,14,18/);
DELIV-DATE , X6((/14);
DESCRIPTION , X20(0,11,12,13,14,18/);
FIRST-NAME , X10(14/11);
INITIAL , U2(14/11);
LAST-NAME , X16(14/11);
LASTSHIPDATE , X6(12/);
ONHANDQTY , J2(14/12);
PRICE , J2(14/);
PURCH-DATE , X6(11/14);
QUANTITY , I1(/14);
STATE , X2(12,13,14,/11);
STOCK# , U8(0,11,12,13,14,18/);
STREET-ADD , S26(12,13,14/11);
SUPPLIER , X16(12,13/);
TAX , J2(14/);
TOTAL , J2(11,14);
UNIT-COST , P8(/12);
ZIP , X6(12,13,14/11);
STORE# , J2(11,12/14); <== attributes to be changed
After attributes change, the ITEMS part of the schema looks like this:
ITEMS:
ACCOUNT , J2(0,11,12,13,14,18/);
BINNUM , Z2(/13);
CITY , X12(12,13,14,/11);
CREDIT-RATING , R2(/14);
DATE , X6(0,11,12,13,14,18/);
DELIV-DATE , X6((/14);
DESCRIPTION , X20(0,11,12,13,14,18/);
FIRST-NAME , X10(14/11);
INITIAL , U2(14/11);
LAST-NAME , X16(14/11);
LASTSHIPDATE , X6(12/);
ONHANDQTY , J2(14/12);
PRICE , J2(14/);
PURCH-DATE , X6(11/14);
QUANTITY , I1(/14);
STATE , X2(12,13,14,/11);
STOCK# , U8(0,11,12,13,14,18/);
STREET-ADD , S26(12,13,14/11);
SUPPLIER , X16(12,13/);
TAX , J2(14/);
TOTAL , J2(11,14);
UNIT-COST , P8(/12);
ZIP , X6(12,13,14/11);
STORE# , X4(11,12/14); <== attributes changed
MPE/iX 5.0 Documentation