WITHIN is a connective that retrieves subitems from a specified item.
A file is comprised of items containing data stored as attributes, values, or subvalues. In addition, subitems that provide a further description of the item can also be included in the file. 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 an attribute containing subitems. Multiple subitems can be made by storing item-IDs as MultiValues in the subvalue attribute.
Two conditions must be met in order for the WITHIN connective to work:
The item specified by the WITHIN connective must contain a MultiValued attribute whose values are item-IDs (the subitems).
The data pointer in the file dictionary must contain this correlative in Attribute 8:
V;;amc |
amc |
Number of the attribute containing the subitems. Both the item specified by WITHIN and the attribute containing the subitems must be in the same file. |
Format
WITHIN filename ' item-ID ' |
Parameter(s)
filename |
Name of the file. |
item-ID |
Item that contains an attribute with subitems to be included in the report. Only one item-ID can be specified per statement. Enclose the item-ID in single quotes. |
Description
Each subitem encountered is assigned a level number. The item-ID specified by the WITHIN connective is Level 1. If this item has subitems, they are assigned Level 2. If Level 2's subitems have subitems, they are assigned Level 3, etc., up to a maximum of 20 levels. Level numbers are printed in the report in front of the item and its subitems.
Example
In this example, the MultiValued attribute SUB-PROD contains item-IDs of the PRODUCT file. This statement lists the item A2000-1234 and three levels of subitems referenced by it:
>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. |
|
|
|
|
|
|
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
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