CHANGE ATTRIBUTES [ DBChange Plus User's Guide ] MPE/iX 5.0 Documentation
DBChange Plus User's Guide
CHANGE ATTRIBUTES
Changes the subitem count, type, and/or length of a data item.
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
types U, X, or Z, the product of the subitem count
and the subitem length must equal an even number.
For data item type P, the product of the subitem
count and the subitem length must be evenly divisible
by 4. If this parameter is omitted, the subitem
count is assumed to be 1.
SubitemType must be a valid data item type: I, J, R, U, X, Z, or
P.
SubitemLength must be an integer from 1 to 200 for data item types
U, X, Z, and P. The length for types I or J must be
1, 2, or 4. For type K, it must be 1 or 2, and for
type R, it must be 2 or 4. For data item types U, X,
or Z, the subitem count and the subitem length must
be an even number. For data item type P, the product
of the subitem count and the subitem length must be
evenly divisible by 4.
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