Immediately following the header must come the variable records. There
must be one variable record for every variable and every 8 characters in
a long string beyond the first 8; i.e., there must be exactly as many
variable records as the value specified for case_size
in the file
header record.
struct sysfile_variable { int32 rec_type; int32 type; int32 has_var_label; int32 n_missing_values; int32 print; int32 write; char name[8]; /* The following two fields are present only if has_var_label is 1. */ int32 label_len; char label[/* variable length */]; /* The following field is present only if n_missing_values is not 0. */ flt64 missing_values[/* variable length*/]; };
int32 rec_type;
int32 type;
int32 has_var_label;
int32 n_missing_values;
int32 print;
int32 write;
char name[8];
int32 label_len;
has_var_label
is set to 1. It is
set to the length, in characters, of the variable label, which must be a
number between 0 and 120.
char label[/* variable length */];
has_var_label
is set to 1. It has
length label_len
, rounded up to the nearest multiple of 32 bits.
The first label_len
characters are the variable's variable label.
flt64 missing_values[/* variable length */];
n_missing_values
is 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.
The print
and write
members of sysfile_variable are output
formats coded into int32
types. The LSB (least-significant byte)
of the 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 MSB (most-significant byte) is not
used and should be set to zero.
Format types are defined as follows:
A
AHEX
COMMA
DOLLAR
F
IB
PIBHEX
P
PIB
PK
RB
RBHEX
Z
N
E
DATE
TIME
DATETIME
ADATE
JDATE
DTIME
WKDAY
MONTH
MOYR
QYR
WKYR
PCT
DOT
CCA
CCB
CCC
CCD
CCE
EDATE
SDATE