Parameters

STRUCTURE = identifiers

Structures whose attributes are to be accessed

SAVE = pointers

Pointer to store copies of the attributes of each structure; these are labelled by the ATTRIBUTE strings

Description

The GETATTRIBUTE directive lets you 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. For the attributes stype, identifier, iprint, margins, associatedidentifier, summarytype and tsmodel, the corresponding element of the pointer is a text structure containing a single line. For the other attributes, the corresponding element of the pointer stores 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 is set to the missing value.

The type setting gives a scalar value indicating the type of structure, by the code:

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).