Next: , Previous: , Up: SPV Light Detail Member Format   [Contents][Index]


D.2.13 Value

Value is used throughout the SPV light member format. It boils down to a number or a string.

Value ⇒ 00? 00? 00? 00? RawValue
RawValue ⇒
    01 ValueMod int[format] double[x]
  | 02 ValueMod int[format] double[x]
    string[varname] string[vallab] (01 | 02 | 03)
  | 03 string[local] ValueMod string[id] string[c] bool[type]
  | 04 ValueMod int[format] string[vallab] string[varname]
    (01 | 02 | 03) string[s]
  | 05 ValueMod string[varname] string[varlabel] (01 | 02 | 03)
  | ValueMod string[format] int[n-args] Argument*[n-args]
Argument ⇒
    i0 Value
  | int[x] i0 Value*[x+1]      /* x > 0 */

There are several possible encodings, which one can distinguish by the first nonzero byte in the encoding.

01

The numeric value x, intended to be presented to the user formatted according to format, which is in the format described for system files. See System File Output Formats, for details. Most commonly, format has width 40 (the maximum).

An x with the maximum negative double value -DBL_MAX represents the system-missing value SYSMIS. (HIGHEST and LOWEST have not been observed.) See System File Format, for more about these special values.

02

Similar to 01, with the additional information that x is a value of variable varname and has value label vallab. Both varname and vallab can be the empty string, the latter very commonly.

The meaning of the final byte is unknown. Possibly it is connected to whether the value or the label should be displayed.

03

A text string, in two forms: c is in English, and sometimes abbreviated or obscure, and local is localized to the user’s locale. In an English-language locale, the two strings are often the same, and in the cases where they differ, local is more appropriate for a user interface, e.g. c of “Not a PxP table for MCN...” versus local of “Computed only for a PxP table, where P must be greater than 1.”

c and local are always either both empty or both nonempty.

id is a brief identifying string whose form seems to resemble a programming language identifier, e.g. cumulative_percent or factor_14. It is not unique.

type is 00 for text taken from user input, such as syntax fragment, expressions, file names, data set names, and 01 for fixed text strings such as names of procedures or statistics. In the former case, id is always the empty string; in the latter case, id is still sometimes empty.

04

The string value s, intended to be presented to the user formatted according to format. The format for a string is not too interesting, and the corpus contains many clearly invalid formats like A16.39 or A255.127 or A134.1, so readers should probably ignore the format entirely.

s is a value of variable varname and has value label vallab. varname is never empty but vallab is commonly empty.

The meaning of the final byte is unknown.

05

Variable varname, which is rarely observed as empty in the corpus, with variable label varlabel, which is often empty.

The meaning of the final byte is unknown.

31 or 58

(These bytes begin a ValueMod.) A format string, analogous to printf, followed by one or more Arguments, each of which has one or more values. The format string uses the following syntax:

\%
\:
\[
\]

Each of these expands to the character following ‘\\’, to escape characters that have special meaning in format strings. These are effective inside and outside the […] syntax forms described below.

\n

Expands to a new-line, inside or outside the […] forms described below.

^i

Expands to a formatted version of argument i, which must have only a single value. For example, ^1 expands to the first argument’s value.

[:a:]i

Expands a for each of the values in i. a should contain one or more ^j conversions, which are drawn from the values for argument i in order. Some examples from the corpus:

[:^1:]1

All of the values for the first argument, concatenated.

[:^1\n:]1

Expands to the values for the first argument, each followed by a new-line.

[:^1 = ^2:]2

Expands to x = y where x is the second argument’s first value and y is its second value. (This would be used only if the argument has two values. If there were more values, the second and third values would be directly concatenated, which would look funny.)

[a:b:]i

This extends the previous form so that the first values are expanded using a and later values are expanded using b. For an unknown reason, within a the ^j conversions are instead written as %j. Some examples from the corpus:

[%1:*^1:]1

Expands to all of the values for the first argument, separated by ‘*’.

[%1 = %2:, ^1 = ^2:]1

Given appropriate values for the first argument, expands to X = 1, Y = 2, Z = 3.

[%1:, ^1:]1

Given appropriate values, expands to 1, 2, 3.

The format string is localized to the user’s locale.


Next: , Previous: , Up: SPV Light Detail Member Format   [Contents][Index]