There must be one variable record for each numeric variable and each string variable with width 8 bytes or less. String variables wider than 8 bytes have one variable record for each 8 bytes, rounding up. The first variable record for a long string specifies the variable's correct dictionary information. Subsequent variable records for a long string are filled with dummy information: a type of -1, no variable label or missing values, print and write formats that are ignored, and an empty string as name. A few system files have been encountered that include a variable label on dummy variable records, so readers should take care to parse dummy variable records in the same way as other variable records.
The dictionary index of a variable is its offset in the set of variable records, including dummy variable records for long string variables. The first variable record has a dictionary index of 0, the second has a dictionary index of 1, and so on.
The system file format does not directly support string variables wider than 255 bytes. Such very long string variables are represented by a number of narrower string variables. See Very Long String Record, for details.
int32 rec_type; int32 type; int32 has_var_label; int32 n_missing_values; int32 print; int32 write; char name; /* Present only if
has_var_labelis 1. */ int32 label_len; char label; /* Present only if
n_missing_valuesis nonzero. */ flt64 missing_values;
has_var_labelis set to 1. It is set to the length, in characters, of the variable label, which must be a number between 0 and 120.
has_var_labelis set to 1. It has length
label_len, rounded up to the nearest multiple of 32 bits. The first
label_lencharacters are the variable's variable label.
n_missing_valuesis not 0. It has the same number of elements as the absolute value of
n_missing_values. For discrete missing values, each element represents one missing value. When a range is present, the first element denotes the minimum value in the range, and the second element denotes the maximum value in the range. When a range plus a value are present, the third element denotes the additional discrete missing value. HIGHEST and LOWEST are indicated as described in the chapter introduction.
write members of sysfile_variable are output
formats coded into
int32 types. The least-significant byte
int32 represents the number of decimal places, and the
next two bytes in order of increasing significance represent field width
and format type, respectively. The most-significant byte is not
used and should be set to zero.
Format types are defined as follows:
Value Meaning 0 Not used. 1
13 Not used. 14 Not used. 15
18 Not used. 19 Not used. 20