GETATTRIBUTE directive
Accesses attributes of structures.
Option
Parameters
Description
The GETATTRIBUTE directive allows you to access attributes of each of the structures that are listed with its STRUCTURE parameter. It refers to the list of structures by pointers, which are set up by the SAVE parameter. You must always set the option and both parameters.
If you request an attribute that is not relevant to a structure, it is omitted from the pointer. Thus for example the nlevels, levels and labels settings are relevant only for factors, and nrows and ncolumns only for matrices. The references to those attributes that you do specify are always stored in the order shown in the definition of the ATTRIBUTE option at the beginning of this subsection.
For attributes that are single numbers, the information is copied into an unnamed scalar which is pointed to by the appropriate element of the pointer; if the attribute has not been set, then the corresponding scalar will contains a missing value. With non-scalar attributes the corresponding element of the pointer will store a reference to the attribute itself. One example is the labels vector of a factor. However, if the factor has no labels vector the corresponding entry of the pointer will be set to the missing value; the same will be true for the levels attribute if the factor has not been declared with levels other than the default integers.
The type setting gives a scalar value indicating the type of structure, by the code:
1 scalar
2 factor
3 text
4 variate
5 matrix
6 diagonal matrix
7 symmetric matrix
8 table
9 ASAVE
10 TSAVE
11 expression
12 formula
13 dummy
14 pointer
15 LRV
16 SSPM
17 TSM
18 RSAVE
22 tree
Alternatively, the stype setting supplies the type name in a text structure. This works not only for the standard GenStat types, such as variates and factors, but also for user-defined types (see STRUCTURE).
Option: ATTRIBUTE.
Parameters: STRUCTURE, SAVE.