GETATTRIBUTE directive

Accesses attributes of structures.


Option

ATTRIBUTE = strings
Which attributes to access (nvalues, nlevels, nrows, ncolumns, type {type number}, stype {type as a character string}, levels, labels {of a factor or pointer}, unitlabels {of a vector}, referencelevel {of a factor}, nmv, present, identifier, refnumber {structure number}, extra, decimals, characters, minimum, maximum, drepresentation, restriction, mode {integer code 1 - 5 denoting type of values: double real, real, integer, character and word}, maxline {of a text or factor}, rows, columns, classification, margins {of a table}, associatedidentifier {of a table}, unknown {cell of a table}, suffixes {of a pointer}, owner, terms {of an SSPM}, groups {of an SSPM}, weights {of an SSPM}, SSPMauxiliary, SSPrst, tsmmodel, rstat {of an RSAVE}, iprint); default * i.e. none


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