A file comprises items containing data stored as attributes, values, or subvalues. In addition to these, subitems that provide a further description of an item may be included in the file, useful when the user wants to create a hierarchical relationship among items.
For example, a file might contain an inventory of parts, some of which are broken down into the subparts of which they are made. The item for servos, for instance, might comprise subitems for d.c. motor, servo board, and servo housing. d.c. motor might break down further into d.c. motor platform and d.c. motor power unit, and so on.
Using the WITHIN connective, a bill of materials may be generated showing the primary item as well as any items that are dependent on it.
Subitems are stored in exactly the same way as are regular items. To make a file item a subitem, its item-ID is stored as a value in another attribute in the file. The attribute that contains the item-IDs of subitems may be MultiValued, and each MultiValue in this attribute is an item-ID for another item stored in the same file.
In addition, the File Definition item in the dictionary (i.e., the D-pointer) must contain a vertical correlative code in line 8. The syntax of the vertical correlative code is:
Format
V ; ; attribute |
Parameter(s)
attribute |
Number of the attribute that contains the item-IDs of the subitems. |
Description
Use the WITHIN connective to retrieve and list subitems of a specified item. The syntax of the WITHIN connective is:
Format
WITHIN filename item-ID |
Description
Only one item-ID may be specified in the query.
When the WITHIN connective is used, each subitem found is assigned a level number. The item-ID specified in the query is level 1. If this item-ID has subitems, they are assigned level 2. If level 2’s items have subitems, they are assigned level 3, and so on up to a maximum of 20 levels. When output is listed, a column called LEVEL is included that shows the corresponding levels of the subitems.
The next statement lists the item A2000-1234 and three levels of subitems it references:
>LIST WITHIN PRODUCT 'A2000-1234' PROD# DESC VALUE LOCATION SUB-PROD QOH ID-SUPP |
||||||
|
|
|
|
|
|
|
PAGE 1 |
|
|
|
15:03:25 DD MMM YYYY |
||
|
|
|
|
|
|
|
LEVEL |
Prod #....... |
Description |
Value |
Location.. |
Sub-Prod... |
On Hand |
|
|
|
|
|
|
|
1 |
A2000-1234 |
SERVOS |
0.73 |
R-123-8888 |
A2001-7811 |
73 |
|
|
|
|
|
A2001-8900 |
|
|
|
|
|
|
A2001-9112 |
|
2 |
A2001-7811 |
D.C. MOTOR |
0.55 |
R-17-1001 |
A2002-1000 |
643 |
|
|
|
|
|
A2002-1023 |
|
3 |
A2002-1000 |
D.C. MOTOR PLATFORM |
0.73 |
R-123-8888 |
|
58 |
3 |
A2002-1023 |
D.C. MTR POWER UNIT |
0.73 |
R-123-1002 |
|
89 |
2 |
A2001-8900 |
SERVO BOARD |
0.12 |
L-44-1001 |
|
329 |
2 |
A2001-9112 |
SERVO HOUSING |
1.09 |
L-17-189 |
A2002-1032 |
107 |
|
|
|
|
|
A2002-1566 |
|
3 |
A2002-1032 |
HOUSING SEALS |
1.02 |
L-09-1889 |
|
768 |
3 |
A2002-1566 |
HOUSING PLATES |
1.03 |
L-1-3309 |
A2004-1111 |
355 |
4 |
A2004-1111 |
HOUSING PACKAGE |
12.00 |
R-12-1212 |
|
455 |
9 ITEMS LISTED. |
|
|
|
|
|
|
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
In the preceding report, the MultiValued attribute SUB-PROD contains item-IDs of the PRODUCT file. The item specified by the WITHIN connective is listed as LEVEL 1. LEVEL 2 lists subitems specified in the Level 1 item’s SUB-PROD attribute. LEVEL 3 lists any subitems specified in the Level 2 item’s SUB-PROD attribute, and one of the Level 3 items even contains a Level 4 subitem.
See Also
Default Processing of INFO/ACCESS Parameters