D1 and D2 Codes - Controlling and Dependent Attributes
The D1 and D2 codes associate controlling and dependent attributes.
Limitation
D1 and D2 codes must be specified in Attribute 8 of the data definition item. The D1 or D2 code can be followed by other conversion codes separated by value marks (CTRL+]), but must be the first code.
Syntax
D1;amcd{;amcd}...
D2;amcc
Syntax Elements
amcd Is the AMC of a dependent associative attribute.
amcc Is the AMC of the controlling associative attribute.
Controlling and Dependent Attributes
You can logically group multivalued attributes in an item with a controlling multivalued attribute. You could, for example, group components of an assembly on an invoice or sales order.
The D1 code defines a controlling associative attribute. Each dependent associative attribute must be defined by a D2 code.
Output Results
If the output for a controlling associative attribute is suppressed by the output specification, the values in the dependent associative attributes are also suppressed.
The values in the dependent associative attributes are output in the order in which they are specified in the data definition item for the controlling attribute. The order in which they are specified in the output specification clause is ignored.
When the processor outputs dependent attributes, it displays an asterisk below the column heading of each.
Example
The PARTS file contains an item named 5330 with DATE as the controlling associative attribute and CODE, UNITS, and PRICE as dependent associative attributes. 20, 21, 22, and 23 are the corresponding attribute numbers. Attribute 8 in the data definition items is set up as follows:
Item | Attribute 8 |
---|---|
DATE | D1;21;22;23 |
CODE | D2;20 |
UNITS | D2;20 |
PRICE | D2;20 |
Sample Report
:LIST PARTS '5330' DATE CODE PRICE UNITS HDR-SUPP PARTS DATE........ CODE.. UNITS.. PRICE.. * * * 5330 07 APR 1994 P 9.50 18 MAR 1994 B 9.50 17 MAR 1994 T 2.00 13 MAR 1994 R 2721 7.50 05 FEB 1994 P 9.20 15 JAN 1994 B 9.20 14 JAN 1994 T 2.00 10 JAN 1994 R 2696 7.20
Note
The processor outputs the dependent attributes in the order in which you have specified them in the controlling attribute's data definition item, not the order specified in the sentence.