Changes from 1.6.1 to 1.6.2:
+ * Previously, numeric variables defaulted to "scale" measurement
+ level. Now, the default is "unknown", with a better guess chosen
+ based on heuristics the first time the data is read.
+
* Bug fixes.
Changes from 1.6.0 to 1.6.1:
@table @code
@item int32 measure;
-The measurement type of the variable:
+The measurement level of the variable:
@table @asis
+@item 0
+Unknown
@item 1
-Nominal Scale
+Nominal
@item 2
-Ordinal Scale
+Ordinal
@item 3
-Continuous Scale
+Scale
@end table
-SPSS sometimes writes a @code{measure} of 0. PSPP interprets this as
-nominal scale.
+An ``unknown'' @code{measure} of 0 means that the variable was created
+in some way that doesn't make the measurement level clear, e.g.@: with
+a @code{COMPUTE} transformation. PSPP sets the measurement level the
+first time it reads the data using the rules documented in
+@ref{Measurement Level,,,pspp, PSPP Users Guide}, so this should
+rarely appear.
@item int32 width;
The width of the display column for the variable in characters.
Similar to print format, but used by the @cmd{WRITE} command
(@pxref{WRITE}).
+@cindex measurement level
+@item Measurement level
+@anchor{Measurement Level}
+One of the following:
+
+@table @asis
+@item Nominal
+Each value of a nominal variable represents a distinct category. The
+possible categories are finite and often have value labels. The order
+of categories is not significant. Political parties, US states, and
+yes/no choices are nominal. Numeric and string variables can be
+nominal.
+
+@item Ordinal
+Ordinal variables also represent distinct categories, but their values
+are arranged according to some natural order. Likert scales, e.g.@:
+from strongly disagree to strongly agree, are ordinal. Data grouped
+into ranges, e.g.@: age groups or income groups, are ordinal. Both
+numeric and string variables can be ordinal. String values are
+ordered alphabetically, so letter grades from A to F will work as
+expected, but @code{poor}, @code{satisfactory}, @code{excellent} will
+not.
+
+@item Scale
+Scale variables are ones for which differences and ratios are
+meaningful. These are often values which have a natural unit
+attached, such as age in years, income in dollars, or distance in
+miles. Only numeric variables are scalar.
+@end table
+
+Variables created by @cmd{COMPUTE} and similar transformations,
+obtained from external sources, etc., initially have an unknown
+measurement level. Any procedure that reads the data will then assign
+a default measurement level. @pspp{} can assign some defaults without
+reading the data:
+
+@itemize @bullet
+@item
+Nominal, if it's a string variable.
+
+@item
+Nominal, if the variable has a WKDAY or MONTH print format.
+
+@item
+Scale, if the variable has a DOLLAR, CCA through CCE, or time or date
+print format.
+@end itemize
+
+Otherwise, @pspp{} reads the data and decides based on its
+distribution:
+
+@itemize @bullet
+@item
+Nominal, if all observations are missing.
+
+@item
+Scale, if one or more valid observations are noninteger or negative.
+
+@item
+Scale, if no valid observation is less than 10.
+
+@item
+Scale, if the variable has 24 or more unique valid values. The value
+24 is the default and can be adjusted (@pxref{SET SCALEMIN}).
+@end itemize
+
+Finally, if none of the above is true, @pspp{} assigns the variable a
+nominal measurement level.
+
@cindex custom attributes
@item Custom attributes
User-defined associations between names and values. @xref{VARIABLE
/SEED=@{RANDOM,@var{seed_value}@}
/UNDEFINED=@{WARN,NOWARN@}
/FUZZBITS=@var{fuzzbits}
+ /SCALEMIN=@var{count}
(data output)
/CC@{A,B,C,D,E@}=@{'@var{npre},@var{pre},@var{suf},@var{nsuf}','@var{npre}.@var{pre}.@var{suf}.@var{nsuf}'@}
possibilities for rounding with the RND operator (@pxref{Miscellaneous
Mathematics}). The default @var{fuzzbits} is 6.
+@item SCALEMIN
+@anchor{SET SCALEMIN}
+The minimum number of distinct valid values for @pspp{} to assume that
+a variable has a scale measurement level. @xref{Measurement Level}.
+
@item WORKSPACE
The maximum amount of memory (in kilobytes) that @pspp{} uses to
store data being processed. If memory in excess of the workspace size
#include "data/transformations.h"
#include "data/variable.h"
#include "libpspp/deque.h"
+#include "libpspp/hash-functions.h"
+#include "libpspp/hmap.h"
#include "libpspp/misc.h"
#include "libpspp/str.h"
#include "libpspp/taint.h"
static void dataset_transformations_changed__ (struct dataset *,
bool non_empty);
+static void add_measurement_level_trns (struct dataset *, struct dictionary *);
+static void cancel_measurement_level_trns (struct trns_chain *);
static void add_case_limit_trns (struct dataset *ds);
static void add_filter_trns (struct dataset *ds);
assert (old->sink == NULL);
assert (!old->temporary);
assert (!old->temporary_trns_chain.n);
+ assert (!old->n_stack);
new = xzalloc (sizeof *new);
new->name = xstrdup (name);
{
struct casereader *reader;
+ assert (ds->n_stack == 0);
assert (ds->source != NULL);
assert (ds->proc_state == PROC_COMMITTED);
add_case_limit_trns (ds);
if (filter)
add_filter_trns (ds);
+ if (!proc_in_temporary_transformations (ds))
+ add_measurement_level_trns (ds, ds->dict);
/* Make permanent_dict refer to the dictionary right before
data reaches the sink. */
/* Dictionary from before TEMPORARY becomes permanent. */
proc_cancel_temporary_transformations (ds);
+ bool ok = proc_cancel_all_transformations (ds) && ds->ok;
if (!ds->discard_output)
{
dict_clear_vectors (ds->dict);
ds->permanent_dict = NULL;
- return proc_cancel_all_transformations (ds) && ds->ok;
+ return ok;
}
/* Casereader class for procedure execution. */
void
proc_start_temporary_transformations (struct dataset *ds)
{
+ assert (!ds->n_stack);
if (!proc_in_temporary_transformations (ds))
{
add_case_limit_trns (ds);
ds->permanent_dict = dict_clone (ds->dict);
+ add_measurement_level_trns (ds, ds->permanent_dict);
ds->temporary = true;
dataset_transformations_changed__ (ds, true);
{
if (proc_in_temporary_transformations (ds))
{
+ cancel_measurement_level_trns (&ds->permanent_trns_chain);
trns_chain_splice (&ds->permanent_trns_chain, &ds->temporary_trns_chain);
ds->temporary = false;
{
if (proc_in_temporary_transformations (ds))
{
+ trns_chain_clear (&ds->temporary_trns_chain);
+
dict_unref (ds->dict);
ds->dict = ds->permanent_dict;
ds->permanent_dict = NULL;
- trns_chain_clear (&ds->temporary_trns_chain);
-
dataset_transformations_changed__ (ds, ds->permanent_trns_chain.n != 0);
return true;
}
ds->n_lag = MAX (ds->n_lag, n_before);
}
\f
+/* Transformation for adding measurement level. */
+
+struct measurement_level_value
+ {
+ struct hmap_node hmap_node;
+ double value;
+ };
+
+struct measurement_level_var
+ {
+ struct variable *var;
+ struct hmap *values;
+ };
+
+static void
+add_measurement_level_var_uninit (struct measurement_level_var *mlv)
+{
+ struct measurement_level_value *mlvalue, *next;
+ HMAP_FOR_EACH_SAFE (mlvalue, next, struct measurement_level_value, hmap_node,
+ mlv->values)
+ {
+ hmap_delete (mlv->values, &mlvalue->hmap_node);
+ free (mlvalue);
+ }
+ hmap_destroy (mlv->values);
+ free (mlv->values);
+}
+
+static enum measure
+add_measurement_level_var_interpret (const struct measurement_level_var *mlv)
+{
+ size_t n = hmap_count (mlv->values);
+ if (!n)
+ {
+ /* All missing (or no data). */
+ return MEASURE_NOMINAL;
+ }
+
+ const struct measurement_level_value *mlvalue;
+ HMAP_FOR_EACH (mlvalue, struct measurement_level_value, hmap_node,
+ mlv->values)
+ if (mlvalue->value < 10)
+ return MEASURE_NOMINAL;
+ return MEASURE_SCALE;
+}
+
+struct measurement_level_trns
+ {
+ struct measurement_level_var *vars;
+ size_t n_vars;
+ };
+
+static enum measure
+add_measurement_level_trns_proc__ (struct measurement_level_var *mlv, double value)
+{
+ if (var_is_num_missing (mlv->var, value))
+ return MEASURE_UNKNOWN;
+ else if (value < 0 || value != floor (value))
+ return MEASURE_SCALE;
+
+ size_t hash = hash_double (value, 0);
+ struct measurement_level_value *mlvalue;
+ HMAP_FOR_EACH_WITH_HASH (mlvalue, struct measurement_level_value, hmap_node,
+ hash, mlv->values)
+ if (mlvalue->value == value)
+ return MEASURE_UNKNOWN;
+
+ mlvalue = xmalloc (sizeof *mlvalue);
+ mlvalue->value = value;
+ hmap_insert (mlv->values, &mlvalue->hmap_node, hash);
+ if (hmap_count (mlv->values) >= settings_get_scalemin ())
+ return MEASURE_SCALE;
+
+ return MEASURE_UNKNOWN;
+}
+
+static enum trns_result
+add_measurement_level_trns_proc (void *mlt_, struct ccase **c,
+ casenumber case_nr UNUSED)
+{
+ struct measurement_level_trns *mlt = mlt_;
+ for (size_t i = 0; i < mlt->n_vars; )
+ {
+ struct measurement_level_var *mlv = &mlt->vars[i];
+ double value = case_num (*c, mlv->var);
+ enum measure m = add_measurement_level_trns_proc__ (mlv, value);
+ if (m != MEASURE_UNKNOWN)
+ {
+ var_set_measure (mlv->var, m);
+
+ add_measurement_level_var_uninit (mlv);
+ *mlv = mlt->vars[--mlt->n_vars];
+ }
+ else
+ i++;
+ }
+ return TRNS_CONTINUE;
+}
+
+static void
+add_measurement_level_trns_free__ (struct measurement_level_trns *mlt)
+{
+ for (size_t i = 0; i < mlt->n_vars; i++)
+ {
+ struct measurement_level_var *mlv = &mlt->vars[i];
+ var_set_measure (mlv->var, add_measurement_level_var_interpret (mlv));
+ add_measurement_level_var_uninit (mlv);
+ }
+ free (mlt->vars);
+ free (mlt);
+}
+
+static bool
+add_measurement_level_trns_free (void *mlt_)
+{
+ struct measurement_level_trns *mlt = mlt_;
+ for (size_t i = 0; i < mlt->n_vars; i++)
+ {
+ struct measurement_level_var *mlv = &mlt->vars[i];
+ var_set_measure (mlv->var, add_measurement_level_var_interpret (mlv));
+ }
+ add_measurement_level_trns_free__ (mlt);
+ return true;
+}
+
+static const struct trns_class add_measurement_level_trns_class = {
+ .name = "add measurement level",
+ .execute = add_measurement_level_trns_proc,
+ .destroy = add_measurement_level_trns_free,
+};
+
+static void
+add_measurement_level_trns (struct dataset *ds, struct dictionary *dict)
+{
+ struct measurement_level_var *mlvs = NULL;
+ size_t n_mlvs = 0;
+ size_t allocated_mlvs = 0;
+
+ for (size_t i = 0; i < dict_get_n_vars (dict); i++)
+ {
+ struct variable *var = dict_get_var (dict, i);
+ if (var_get_measure (var) != MEASURE_UNKNOWN)
+ continue;
+
+ const struct fmt_spec *f = var_get_print_format (var);
+ enum measure m = var_default_measure_for_format (f->type);
+ if (m != MEASURE_UNKNOWN)
+ {
+ var_set_measure (var, m);
+ continue;
+ }
+
+ if (n_mlvs >= allocated_mlvs)
+ mlvs = x2nrealloc (mlvs, &allocated_mlvs, sizeof *mlvs);
+
+ struct measurement_level_var *mlv = &mlvs[n_mlvs++];
+ *mlv = (struct measurement_level_var) {
+ .var = var,
+ .values = xmalloc (sizeof *mlv->values),
+ };
+ hmap_init (mlv->values);
+ }
+ if (!n_mlvs)
+ return;
+
+ struct measurement_level_trns *mlt = xmalloc (sizeof *mlt);
+ *mlt = (struct measurement_level_trns) {
+ .vars = mlvs,
+ .n_vars = n_mlvs,
+ };
+ add_transformation (ds, &add_measurement_level_trns_class, mlt);
+}
+
+static void
+cancel_measurement_level_trns (struct trns_chain *chain)
+{
+ if (!chain->n)
+ return;
+
+ struct transformation *trns = &chain->xforms[chain->n - 1];
+ if (trns->class != &add_measurement_level_trns_class)
+ return;
+
+ struct measurement_level_trns *mlt = trns->aux;
+ add_measurement_level_trns_free__ (mlt);
+ chain->n--;
+}
+\f
static void
dataset_changed__ (struct dataset *ds)
{
struct fmt_spec default_format;
bool testing_mode;
int fuzzbits;
+ int scalemin;
int cmd_algorithm;
int global_algorithm;
.default_format = { .type = FMT_F, .w = 8, .d = 2 },
.testing_mode = false,
.fuzzbits = 6,
+ .scalemin = 24,
.cmd_algorithm = ENHANCED,
.global_algorithm = ENHANCED,
.syntax = ENHANCED,
the_settings.fuzzbits = fuzzbits;
}
+int
+settings_get_scalemin (void)
+{
+ return the_settings.scalemin;
+}
+
+void
+settings_set_scalemin (int scalemin)
+{
+ the_settings.scalemin = scalemin;
+}
+
/* Return the current algorithm setting */
enum behavior_mode
settings_get_algorithm (void)
int settings_get_fuzzbits (void);
void settings_set_fuzzbits (int);
+int settings_get_scalemin (void);
+void settings_set_scalemin (int);
+
/* Whether to show variable or value labels or the underlying value or variable
name. */
enum ATTRIBUTE ((packed)) settings_value_show
const GEnumValue measure[] =
{
+ {MEASURE_UNKNOWN, "unknown", N_("Unknown")},
{MEASURE_NOMINAL, "nominal", N_("Nominal")},
{MEASURE_ORDINAL, "ordinal", N_("Ordinal")},
{MEASURE_SCALE, "scale", N_("Scale")},
v->leave = var_must_leave (v);
type = val_type_from_width (width);
v->alignment = var_default_alignment (type);
- v->measure = var_default_measure (type);
+ v->measure = var_default_measure_for_type (type);
v->role = ROLE_INPUT;
v->display_width = var_default_display_width (width);
v->print = v->write = var_default_formats (width);
bool
measure_is_valid (enum measure m)
{
- return m == MEASURE_NOMINAL || m == MEASURE_ORDINAL || m == MEASURE_SCALE;
+ return (m == MEASURE_UNKNOWN || m == MEASURE_NOMINAL
+ || m == MEASURE_ORDINAL || m == MEASURE_SCALE);
}
/* Returns a string version of measurement level M, for display to a user.
used to reset a variable's measurement level to the
default. */
enum measure
-var_default_measure (enum val_type type)
+var_default_measure_for_type (enum val_type type)
{
- return type == VAL_NUMERIC ? MEASURE_SCALE : MEASURE_NOMINAL;
+ return type == VAL_NUMERIC ? MEASURE_UNKNOWN : MEASURE_NOMINAL;
+}
+
+/* Returns the default measurement level for a variable with the given
+ FORMAT, or MEASURE_UNKNOWN if there is no good default. */
+enum measure
+var_default_measure_for_format (enum fmt_type format)
+{
+ if (format == FMT_DOLLAR)
+ return MEASURE_SCALE;
+
+ switch (fmt_get_category (format))
+ {
+ case FMT_CAT_BASIC:
+ case FMT_CAT_LEGACY:
+ case FMT_CAT_BINARY:
+ case FMT_CAT_HEXADECIMAL:
+ return MEASURE_UNKNOWN;
+
+ case FMT_CAT_CUSTOM:
+ case FMT_CAT_DATE:
+ case FMT_CAT_TIME:
+ return MEASURE_SCALE;
+
+ case FMT_CAT_DATE_COMPONENT:
+ case FMT_CAT_STRING:
+ return MEASURE_NOMINAL;
+ }
+
+ NOT_REACHED ();
}
\f
/* Returns true if M is a valid variable role,
/* How data is measured. */
enum measure
{
- MEASURE_NOMINAL = 0,
- MEASURE_ORDINAL = 1,
- MEASURE_SCALE = 2,
+ MEASURE_UNKNOWN = 0,
+ MEASURE_NOMINAL = 1,
+ MEASURE_ORDINAL = 2,
+ MEASURE_SCALE = 3,
n_MEASURES
};
enum measure var_get_measure (const struct variable *);
void var_set_measure (struct variable *, enum measure);
-enum measure var_default_measure (enum val_type);
+enum measure var_default_measure_for_type (enum val_type);
+enum measure var_default_measure_for_format (enum fmt_type);
/* Intended usage of a variable, for populating dialogs. */
enum var_role
if (!strcasecmp (names[i], "ROWTYPE_"))
dict_create_var_assert (dict, "ROWTYPE_", 8);
else
- dict_create_var_assert (dict, names[i], 0);
+ {
+ struct variable *var = dict_create_var_assert (dict, names[i], 0);
+ var_set_measure (var, MEASURE_SCALE);
+ }
for (size_t i = 0; i < n_names; ++i)
free (names[i]);
}
*tv = true;
+ var_set_measure (v, MEASURE_NOMINAL);
var_set_both_formats (v, &(struct fmt_spec) { .type = FMT_F, .w = 4 });
}
return true;
mf.svars = xmalloc (sizeof *mf.svars);
mf.svars[0] = dict_create_var_assert (dict, lex_tokcstr (lexer),
0);
+ var_set_measure (mf.svars[0], MEASURE_NOMINAL);
var_set_both_formats (
mf.svars[0], &(struct fmt_spec) { .type = FMT_F, .w = 4 });
mf.n_svars = 1;
rank_savage
};
+static enum measure rank_measures[n_RANK_FUNCS] = {
+ [RANK] = MEASURE_ORDINAL,
+ [NORMAL] = MEASURE_ORDINAL,
+ [PERCENT] = MEASURE_ORDINAL,
+ [RFRACTION] = MEASURE_ORDINAL,
+ [PROPORTION] = MEASURE_ORDINAL,
+ [N] = MEASURE_SCALE,
+ [NTILES] = MEASURE_ORDINAL,
+ [SAVAGE] = MEASURE_ORDINAL,
+};
enum ties
{
var = dict_create_var_assert (d, rs->dest_names[i], 0);
var_set_both_formats (var, &dest_format[rs->rfunc]);
var_set_label (var, rs->dest_labels[i]);
+ var_set_measure (var, rank_measures[rs->rfunc]);
iv->output_vars[j] = var;
}
case FMT_CAT_STRING:
switch (measure)
{
+ case MEASURE_UNKNOWN: return "role-none";
case MEASURE_NOMINAL: return "measure-string-nominal";
case MEASURE_ORDINAL: return "measure-string-ordinal";
case MEASURE_SCALE: return "role-none";
case FMT_CAT_TIME:
switch (measure)
{
+ case MEASURE_UNKNOWN: return "role-none";
case MEASURE_NOMINAL: return "measure-date-nominal";
case MEASURE_ORDINAL: return "measure-date-ordinal";
case MEASURE_SCALE: return "measure-date-scale";
default:
switch (measure)
{
+ case MEASURE_UNKNOWN: return "role-none";
case MEASURE_NOMINAL: return "measure-nominal";
case MEASURE_ORDINAL: return "measure-ordinal";
case MEASURE_SCALE: return "measure-scale";
if (var_has_label (var))
syntax_gen_pspp (s, "VARIABLE LABELS %ss %sq.\n",
name, var_get_label (var));
- if (measure != var_default_measure (type))
+ if (measure != var_default_measure_for_type (type)
+ && measure != MEASURE_UNKNOWN)
syntax_gen_pspp (s, "VARIABLE LEVEL %ss (%ss).\n",
name, measure_to_syntax (measure));
if (role != ROLE_INPUT)
Table: Variables
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
-NUM1,1,,Scale,Input,8,Right,F8.0,F8.0,
-NUM2,2,Numeric variable 2's label,Scale,Input,8,Right,F8.0,F8.0,
-NUM3,3,,Scale,Input,8,Right,F8.0,F8.0,1
-NUM4,4,Another numeric variable label,Scale,Input,8,Right,F8.0,F8.0,2
+NUM1,1,,Unknown,Input,8,Right,F8.0,F8.0,
+NUM2,2,Numeric variable 2's label,Unknown,Input,8,Right,F8.0,F8.0,
+NUM3,3,,Unknown,Input,8,Right,F8.0,F8.0,1
+NUM4,4,Another numeric variable label,Unknown,Input,8,Right,F8.0,F8.0,2
STR1,5,,Nominal,Input,8,Left,A8,A8,
STR2,6,STR2's variable label,Nominal,Input,4,Left,A4,A4,
STR3,7,,Nominal,Input,5,Left,A5,A5,"""MISS """
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-NUM1,1,Scale,Input,8,Right,F8.0,F8.0
-NUM2,2,Scale,Input,8,Right,F8.0,F8.0
-NUM3,3,Scale,Input,8,Right,F8.0,F8.0
-NUM4,4,Scale,Input,8,Right,F8.0,F8.0
-NUM5,5,Scale,Input,8,Right,F8.0,F8.0
+NUM1,1,Unknown,Input,8,Right,F8.0,F8.0
+NUM2,2,Unknown,Input,8,Right,F8.0,F8.0
+NUM3,3,Unknown,Input,8,Right,F8.0,F8.0
+NUM4,4,Unknown,Input,8,Right,F8.0,F8.0
+NUM5,5,Unknown,Input,8,Right,F8.0,F8.0
STR1,6,Nominal,Input,1,Left,A1,A1
STR2,7,Nominal,Input,2,Left,A2,A2
STR3,8,Nominal,Input,3,Left,A3,A3
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-NUM1,1,Scale,Input,8,Right,F8.0,F8.0
-NUM2,2,Scale,Input,8,Right,F8.0,F8.0
+NUM1,1,Unknown,Input,8,Right,F8.0,F8.0
+NUM2,2,Unknown,Input,8,Right,F8.0,F8.0
STR4,3,Nominal,Input,4,Left,A4,A4
STR8,4,Nominal,Input,8,Left,A8,A8
STR15,5,Nominal,Input,15,Left,A15,A15
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-NUM1,1,Scale,Input,8,Right,F8.0,F8.0
-NUM2,2,Scale,Input,8,Right,F8.0,F8.0
-NUM3,3,Scale,Input,8,Right,F8.0,F8.0
-NUM4,4,Scale,Input,8,Right,F8.0,F8.0
+NUM1,1,Unknown,Input,8,Right,F8.0,F8.0
+NUM2,2,Unknown,Input,8,Right,F8.0,F8.0
+NUM3,3,Unknown,Input,8,Right,F8.0,F8.0
+NUM4,4,Unknown,Input,8,Right,F8.0,F8.0
])
AT_CLEANUP
\f
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-NUM1,1,Scale,Input,8,Right,F8.0,F8.0
-NUM2,2,Scale,Input,8,Right,F8.0,F8.0
-NUM3,3,Scale,Input,8,Right,F8.0,F8.0
-NUM4,4,Scale,Input,8,Right,F8.0,F8.0
+NUM1,1,Unknown,Input,8,Right,F8.0,F8.0
+NUM2,2,Unknown,Input,8,Right,F8.0,F8.0
+NUM3,3,Unknown,Input,8,Right,F8.0,F8.0
+NUM4,4,Unknown,Input,8,Right,F8.0,F8.0
Table: Data List
NUM1,NUM2,NUM3,NUM4
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-NUM1,1,Scale,Input,8,Right,F8.0,F8.0
-NUM2,2,Scale,Input,8,Right,F8.0,F8.0
-NUM3,3,Scale,Input,8,Right,F8.0,F8.0
-NUM4,4,Scale,Input,8,Right,F8.0,F8.0
+NUM1,1,Unknown,Input,8,Right,F8.0,F8.0
+NUM2,2,Unknown,Input,8,Right,F8.0,F8.0
+NUM3,3,Unknown,Input,8,Right,F8.0,F8.0
+NUM4,4,Unknown,Input,8,Right,F8.0,F8.0
])
AT_CLEANUP
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-NUM1,1,Scale,Input,8,Right,F8.0,F8.0
-NUM2,2,Scale,Input,8,Right,F8.0,F8.0
+NUM1,1,Unknown,Input,8,Right,F8.0,F8.0
+NUM2,2,Unknown,Input,8,Right,F8.0,F8.0
STR4,3,Nominal,Input,4,Left,A4,A4
STR8,4,Nominal,Input,8,Left,A8,A8
STR15,5,Nominal,Input,15,Left,A15,A15
AT_CHECK([pspp -O format=csv export.sps])
AT_DATA([import.sps], [dnl
IMPORT FILE='data.por'.
+EXECUTE.
DISPLAY DICTIONARY.
LIST.
])
AT_CHECK([pspp -O format=csv import.sps], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-VAR1,1,Scale,Input,8,Right,F1.0,F1.0
-VAR2,2,Scale,Input,8,Right,F1.0,F1.0
-VAR3,3,Scale,Input,8,Right,F1.0,F1.0
-VAR4,4,Scale,Input,8,Right,F1.0,F1.0
-VAR5,5,Scale,Input,8,Right,F1.0,F1.0
+VAR1,1,Nominal,Input,8,Right,F1.0,F1.0
+VAR2,2,Nominal,Input,8,Right,F1.0,F1.0
+VAR3,3,Nominal,Input,8,Right,F1.0,F1.0
+VAR4,4,Nominal,Input,8,Right,F1.0,F1.0
+VAR5,5,Nominal,Input,8,Right,F1.0,F1.0
Table: Value Labels
Variable Value,,Label
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-VAR1,1,Scale,Input,8,Right,F1.0,F1.0
-VAR2,2,Scale,Input,8,Right,F1.0,F1.0
-VAR3,3,Scale,Input,8,Right,F1.0,F1.0
-VAR4,4,Scale,Input,8,Right,F1.0,F1.0
-VAR5,5,Scale,Input,8,Right,F1.0,F1.0
+VAR1,1,Unknown,Input,8,Right,F1.0,F1.0
+VAR2,2,Unknown,Input,8,Right,F1.0,F1.0
+VAR3,3,Unknown,Input,8,Right,F1.0,F1.0
+VAR4,4,Unknown,Input,8,Right,F1.0,F1.0
+VAR5,5,Unknown,Input,8,Right,F1.0,F1.0
Table: Value Labels
Variable Value,,Label
Table: Variables
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
-num1,1,,Scale,Input,8,Right,F8.0,F8.0,
-num2,2,Numeric variable 2's label (ùúû),Scale,Input,8,Right,F8.0,F8.0,
-num3,3,,Scale,Input,8,Right,F8.0,F8.0,1
-num4,4,Another numeric variable label,Scale,Input,8,Right,F8.0,F8.0,1
-num5,5,,Scale,Input,8,Right,F8.0,F8.0,1; 2
-num6,6,,Scale,Input,8,Right,F8.0,F8.0,1; 2; 3
-num7,7,,Scale,Input,8,Right,F8.0,F8.0,1 THRU 3
-num8,8,,Scale,Input,8,Right,F8.0,F8.0,1 THRU 3; 5
-num9,9,,Scale,Input,8,Right,F8.0,F8.0,1 THRU HIGHEST; -5
-numàèìñò,10,,Scale,Input,8,Right,F8.0,F8.0,LOWEST THRU 1; 5
+num1,1,,Unknown,Input,8,Right,F8.0,F8.0,
+num2,2,Numeric variable 2's label (ùúû),Unknown,Input,8,Right,F8.0,F8.0,
+num3,3,,Unknown,Input,8,Right,F8.0,F8.0,1
+num4,4,Another numeric variable label,Unknown,Input,8,Right,F8.0,F8.0,1
+num5,5,,Unknown,Input,8,Right,F8.0,F8.0,1; 2
+num6,6,,Unknown,Input,8,Right,F8.0,F8.0,1; 2; 3
+num7,7,,Unknown,Input,8,Right,F8.0,F8.0,1 THRU 3
+num8,8,,Unknown,Input,8,Right,F8.0,F8.0,1 THRU 3; 5
+num9,9,,Unknown,Input,8,Right,F8.0,F8.0,1 THRU HIGHEST; -5
+numàèìñò,10,,Unknown,Input,8,Right,F8.0,F8.0,LOWEST THRU 1; 5
str1,11,,Nominal,Input,4,Left,A4,A4,
str2,12,String variable 2's label,Nominal,Input,4,Left,A4,A4,
str3,13,,Nominal,Input,4,Left,A4,A4,"""MISS"""
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Variables
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-num1,1,,Scale,Input,8,Right,F8.0,F8.0
-num2,2,Numeric variable 2's label,Scale,Input,8,Right,F8.0,F8.0
+num1,1,,Unknown,Input,8,Right,F8.0,F8.0
+num2,2,Numeric variable 2's label,Unknown,Input,8,Right,F8.0,F8.0
Table: Data List
num1,num2
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Variables
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-num1,1,,Scale,Input,8,Right,F8.0,F8.0
-num2,2,Numeric variable 2's label,Scale,Input,8,Right,F8.0,F8.0
+num1,1,,Unknown,Input,8,Right,F8.0,F8.0
+num2,2,Numeric variable 2's label,Unknown,Input,8,Right,F8.0,F8.0
Table: Data List
num1,num2
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-num1,1,Scale,Input,8,Right,F8.0,F8.0
-num2,2,Scale,Input,8,Right,F8.0,F8.0
-num3,3,Scale,Input,8,Right,F8.0,F8.0
-num4,4,Scale,Input,8,Right,F8.0,F8.0
-num5,5,Scale,Input,8,Right,F8.0,F8.0
+num1,1,Unknown,Input,8,Right,F8.0,F8.0
+num2,2,Unknown,Input,8,Right,F8.0,F8.0
+num3,3,Unknown,Input,8,Right,F8.0,F8.0
+num4,4,Unknown,Input,8,Right,F8.0,F8.0
+num5,5,Unknown,Input,8,Right,F8.0,F8.0
str1,6,Nominal,Input,1,Left,A1,A1
str2,7,Nominal,Input,2,Left,A2,A2
str3,8,Nominal,Input,3,Left,A3,A3
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-LongVariableName1,1,Scale,Input,8,Right,F8.0,F8.0
-LongVariableName2,2,Scale,Input,8,Right,F8.0,F8.0
-LongVariableName3,3,Scale,Input,8,Right,F8.0,F8.0
-LongVariableName4,4,Scale,Input,8,Right,F8.0,F8.0
-Coördinate_X,5,Scale,Input,8,Right,F8.0,F8.0
-Coördinate_Y,6,Scale,Input,8,Right,F8.0,F8.0
-Coördinate_Z,7,Scale,Input,8,Right,F8.0,F8.0
+LongVariableName1,1,Unknown,Input,8,Right,F8.0,F8.0
+LongVariableName2,2,Unknown,Input,8,Right,F8.0,F8.0
+LongVariableName3,3,Unknown,Input,8,Right,F8.0,F8.0
+LongVariableName4,4,Unknown,Input,8,Right,F8.0,F8.0
+Coördinate_X,5,Unknown,Input,8,Right,F8.0,F8.0
+Coördinate_Y,6,Unknown,Input,8,Right,F8.0,F8.0
+Coördinate_Z,7,Unknown,Input,8,Right,F8.0,F8.0
])
done
AT_CLEANUP
AT_CHECK([cat pspp.csv], [0],
[[Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-FirstVariable,1,Scale,Output,8,Right,F8.0,F8.0
-SécondVariable,2,Scale,Input,8,Right,F8.0,F8.0
-ThirdVariable,3,Scale,Input,8,Right,F8.0,F8.0
+FirstVariable,1,Unknown,Output,8,Right,F8.0,F8.0
+SécondVariable,2,Unknown,Input,8,Right,F8.0,F8.0
+ThirdVariable,3,Unknown,Input,8,Right,F8.0,F8.0
]])
done
AT_CLEANUP
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-i,1,Scale,Input,8,Right,F8.0,F8.0
-o,2,Scale,Output,8,Right,F8.0,F8.0
-b,3,Scale,Both,8,Right,F8.0,F8.0
-n,4,Scale,None,8,Right,F8.0,F8.0
-p,5,Scale,Partition,8,Right,F8.0,F8.0
-s,6,Scale,Split,8,Right,F8.0,F8.0
-x,7,Scale,Input,8,Right,F8.0,F8.0
+i,1,Unknown,Input,8,Right,F8.0,F8.0
+o,2,Unknown,Output,8,Right,F8.0,F8.0
+b,3,Unknown,Both,8,Right,F8.0,F8.0
+n,4,Unknown,None,8,Right,F8.0,F8.0
+p,5,Unknown,Partition,8,Right,F8.0,F8.0
+s,6,Unknown,Split,8,Right,F8.0,F8.0
+x,7,Unknown,Input,8,Right,F8.0,F8.0
])
done
AT_CLEANUP
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-num1,1,Scale,Input,8,Right,F8.0,F8.0
-num2,2,Scale,Input,8,Right,F8.0,F8.0
+num1,1,Unknown,Input,8,Right,F8.0,F8.0
+num2,2,Unknown,Input,8,Right,F8.0,F8.0
str4,3,Nominal,Input,4,Left,A4,A4
str8,4,Nominal,Input,8,Left,A8,A8
str15,5,Nominal,Input,15,Left,A15,A15
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-num1,1,Scale,Input,8,Right,F8.0,F8.0
-num2,2,Scale,Input,8,Right,F8.0,F8.0
+num1,1,Unknown,Input,8,Right,F8.0,F8.0
+num2,2,Unknown,Input,8,Right,F8.0,F8.0
str4,3,Nominal,Input,4,Left,A4,A4
str8,4,Nominal,Input,8,Left,A8,A8
str15,5,Nominal,Input,15,Left,A15,A15
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-num1,1,Scale,Input,8,Right,F8.0,F8.0
-num2,2,Scale,Input,8,Right,F8.0,F8.0
+num1,1,Unknown,Input,8,Right,F8.0,F8.0
+num2,2,Unknown,Input,8,Right,F8.0,F8.0
str4,3,Nominal,Input,4,Left,A4,A4
str8,4,Nominal,Input,8,Left,A8,A8
str15,5,Nominal,Input,15,Left,A15,A15
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-num1,1,Scale,Input,8,Right,F8.0,F8.0
-num2,2,Scale,Input,8,Right,F8.0,F8.0
+num1,1,Unknown,Input,8,Right,F8.0,F8.0
+num2,2,Unknown,Input,8,Right,F8.0,F8.0
str4,3,Nominal,Input,4,Left,A4,A4
str8,4,Nominal,Input,8,Left,A8,A8
str15,5,Nominal,Input,15,Left,A15,A15
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-var1,1,Scale,Input,8,Right,F8.0,F8.0
-var001,2,Scale,Input,8,Right,F8.0,F8.0
+var1,1,Unknown,Input,8,Right,F8.0,F8.0
+var001,2,Unknown,Input,8,Right,F8.0,F8.0
])
done
AT_CLEANUP
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
-num1,1,Scale,Input,8,Right,F8.0,F8.0,
+num1,1,Unknown,Input,8,Right,F8.0,F8.0,
str1,2,Nominal,Input,9,Left,A9,A9,
str2,3,Nominal,Input,10,Left,A10,A10,"""abcdefgh""; ""ijklmnop""; ""qrstuvwx"""
str3,4,Nominal,Input,11,Left,A11,A11,
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-num1,1,Scale,Input,8,Right,F8.0,F8.0
+num1,1,Unknown,Input,8,Right,F8.0,F8.0
str1,2,Nominal,Input,4,Left,A4,A4
])
done
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-num1,1,Scale,Input,8,Right,F8.0,F8.0
+num1,1,Unknown,Input,8,Right,F8.0,F8.0
])
done
AT_CLEANUP
Table: Variables
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-àéîöçxyzabc,1,,Scale,Input,8,Right,F8.2,F8.2
+àéîöçxyzabc,1,,Nominal,Input,8,Right,F8.2,F8.2
roué,2,Provençal soupçon,Nominal,Input,9,Left,A9,A9
croûton,3,,Nominal,Input,32,Left,A1000,A1000
AT_DATA([readnames.sps],[dnl
GET DATA /TYPE=ODS /FILE='this.ods' /CELLRANGE=RANGE 'A1:H8' /READNAMES=ON
+EXECUTE.
DISPLAY DICTIONARY.
LIST.
])
AT_CHECK([pspp -O format=csv readnames.sps], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-freda,1,Scale,Input,8,Right,F8.2,F8.2
-fred,2,Scale,Input,8,Right,F8.2,F8.2
-fred_A,3,Scale,Input,8,Right,F8.2,F8.2
-fred_B,4,Scale,Input,8,Right,F8.2,F8.2
-fred_C,5,Scale,Input,8,Right,F8.2,F8.2
-fred_D,6,Scale,Input,8,Right,F8.2,F8.2
-fred_E,7,Scale,Input,8,Right,F8.2,F8.2
+freda,1,Nominal,Input,8,Right,F8.2,F8.2
+fred,2,Nominal,Input,8,Right,F8.2,F8.2
+fred_A,3,Nominal,Input,8,Right,F8.2,F8.2
+fred_B,4,Nominal,Input,8,Right,F8.2,F8.2
+fred_C,5,Nominal,Input,8,Right,F8.2,F8.2
+fred_D,6,Nominal,Input,8,Right,F8.2,F8.2
+fred_E,7,Nominal,Input,8,Right,F8.2,F8.2
Table: Data List
freda,fred,fred_A,fred_B,fred_C,fred_D,fred_E
AT_CHECK([pspp -O format=csv matrix-data.sps], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-s1,1,Scale,Input,8,Right,F4.0,F4.0
-s2,2,Scale,Input,8,Right,F4.0,F4.0
+s1,1,Nominal,Input,8,Right,F4.0,F4.0
+s2,2,Nominal,Input,8,Right,F4.0,F4.0
ROWTYPE_,3,Nominal,Input,8,Left,A8,A8
VARNAME_,4,Nominal,Input,8,Left,A8,A8
var01,5,Scale,Input,8,Right,F10.4,F10.4
AT_CHECK([pspp matrix-data.sps -O format=csv], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-s,1,Scale,Input,8,Right,F4.0,F4.0
+s,1,Nominal,Input,8,Right,F4.0,F4.0
ROWTYPE_,2,Nominal,Input,8,Left,A8,A8
-f,3,Scale,Input,8,Right,F4.0,F4.0
+f,3,Nominal,Input,8,Right,F4.0,F4.0
VARNAME_,4,Nominal,Input,8,Left,A8,A8
var01,5,Scale,Input,8,Right,F10.4,F10.4
var02,6,Scale,Input,8,Right,F10.4,F10.4
AT_CHECK([pspp -O format=csv apply-dict.sps], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-foo,1,Scale,Input,8,Right,F8.2,F8.2
-bar,2,Scale,Input,8,Right,F8.2,F8.2
+foo,1,Nominal,Input,8,Right,F8.2,F8.2
+bar,2,Nominal,Input,8,Right,F8.2,F8.2
"apply-dict.sps:12: warning: APPLY DICTIONARY: Variable bar is numeric in target file, but string in source file."
Table: Variables
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-foo,1,This is a label,Scale,Input,8,Right,TIME22.0,TIME22.0
-bar,2,,Scale,Input,8,Right,F8.2,F8.2
+foo,1,This is a label,Nominal,Input,8,Right,TIME22.0,TIME22.0
+bar,2,,Nominal,Input,8,Right,F8.2,F8.2
])
AT_CLEANUP
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-x,1,Scale,Input,8,Right,F8.2,F8.2
+x,1,Nominal,Input,8,Right,F8.2,F8.2
name,2,Nominal,Input,10,Left,A10,A10
])
AT_CLEANUP
AT_CHECK([pspp -O format=csv value-labels.sps], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-ad,1,Scale,Input,8,Right,ADATE10,ADATE10
-dt,2,Scale,Input,8,Right,DATETIME20.0,DATETIME20.0
+ad,1,Unknown,Input,8,Right,ADATE10,ADATE10
+dt,2,Unknown,Input,8,Right,DATETIME20.0,DATETIME20.0
Table: Value Labels
Variable Value,,Label
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-x,1,Scale,Input,8,Right,F8.2,F8.2
+x,1,Nominal,Input,8,Right,F8.2,F8.2
Table: Value Labels
Variable Value,,Label
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Variables
Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-x,1,Scale,Input,8,Right,F8.2,F8.2
+x,1,Nominal,Input,8,Right,F8.2,F8.2
Table: Value Labels
Variable Value,,Label
])
AT_CLEANUP
+AT_SETUP([variable level inference and SCALEMIN])
+AT_DATA([var-level.sps], [dnl
+DATA LIST LIST NOTABLE /n1 to n3 s1 to s5.
+
+* Nominal formats (copied from data that will default to scale).
+COMPUTE n4=s1.
+COMPUTE n5=s1.
+FORMATS n4(WKDAY5) n5(MONTH5).
+
+* Scale formats (copied from data that will default to nominal).
+COMPUTE s6=n1.
+COMPUTE s7=n1.
+COMPUTE s8=n1.
+FORMATS s6(DOLLAR6.2) s7(CCA8.2) s8(DATETIME17).
+
+STRING string(A8).
+DISPLAY DICTIONARY.
+EXECUTE.
+
+* n1 has 10 unique small values -> nominal.
+* n2 has 23 unique small values -> nominal.
+* n3 is all missing -> nominal.
+* s1 has 24 unique small values -> scale.
+* s2 has one negative value -> scale.
+* s3 has one non-integer value -> scale.
+* s4 has no valid values less than 10 -> scale.
+* s5 has no valid values less than 10,000 -> scale.
+BEGIN DATA.
+1 1 . 1 1 1 10 10001
+2 2 . 2 2 2 11 10002
+3 3 . 3 3 3 12 10003
+4 4 . 4 4 4 13 10004
+5 5 . 5 5 5 14 10005
+6 6 . 6 6 6 15 10006
+7 7 . 7 7 7 16 10007
+8 8 . 8 8 8 17 10008
+9 9 . 9 9 9 18 10009
+10 10 . 10 10 10.5 19 110000
+1 11 . 11 -1 1 11 10001
+2 12 . 12 2 2 12 10002
+3 13 . 13 3 3 13 10003
+4 14 . 14 4 4 14 10004
+5 15 . 15 5 5 15 10005
+6 16 . 16 6 6 16 10006
+7 17 . 17 7 7 17 10007
+8 18 . 18 8 8 18 10008
+9 19 . 19 9 9 19 10009
+1 20 . 20 1 1 20 10001
+2 21 . 21 2 2 21 10002
+3 22 . 22 3 3 22 10003
+4 23 . 23 4 4 23 10004
+5 23 . 24 5 5 24 10005
+6 23 . 24 6 6 25 10006
+END DATA.
+DISPLAY DICTIONARY.
+])
+AT_CHECK([pspp -o pspp.csv var-level.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Variables
+Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
+n1,1,Unknown,Input,8,Right,F8.2,F8.2
+n2,2,Unknown,Input,8,Right,F8.2,F8.2
+n3,3,Unknown,Input,8,Right,F8.2,F8.2
+s1,4,Unknown,Input,8,Right,F8.2,F8.2
+s2,5,Unknown,Input,8,Right,F8.2,F8.2
+s3,6,Unknown,Input,8,Right,F8.2,F8.2
+s4,7,Unknown,Input,8,Right,F8.2,F8.2
+s5,8,Unknown,Input,8,Right,F8.2,F8.2
+n4,9,Unknown,Input,8,Right,WKDAY5,WKDAY5
+n5,10,Unknown,Input,8,Right,MONTH5,MONTH5
+s6,11,Unknown,Input,8,Right,DOLLAR6.2,DOLLAR6.2
+s7,12,Unknown,Input,8,Right,CCA8.2,CCA8.2
+s8,13,Unknown,Input,8,Right,DATETIME17.0,DATETIME17.0
+string,14,Nominal,Input,8,Left,A8,A8
+
+Table: Variables
+Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
+n1,1,Nominal,Input,8,Right,F8.2,F8.2
+n2,2,Nominal,Input,8,Right,F8.2,F8.2
+n3,3,Nominal,Input,8,Right,F8.2,F8.2
+s1,4,Scale,Input,8,Right,F8.2,F8.2
+s2,5,Scale,Input,8,Right,F8.2,F8.2
+s3,6,Scale,Input,8,Right,F8.2,F8.2
+s4,7,Scale,Input,8,Right,F8.2,F8.2
+s5,8,Scale,Input,8,Right,F8.2,F8.2
+n4,9,Nominal,Input,8,Right,WKDAY5,WKDAY5
+n5,10,Nominal,Input,8,Right,MONTH5,MONTH5
+s6,11,Scale,Input,8,Right,DOLLAR6.2,DOLLAR6.2
+s7,12,Scale,Input,8,Right,CCA8.2,CCA8.2
+s8,13,Scale,Input,8,Right,DATETIME17.0,DATETIME17.0
+string,14,Nominal,Input,8,Left,A8,A8
+])
+AT_CLEANUP
AT_BANNER([VARIABLE LABELS])
Table: Variables
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-new,3,tracking my stuff,Scale,Input,8,Right,F1.0,F1.0
+new,3,tracking my stuff,Nominal,Input,8,Right,F1.0,F1.0
Table: Value Labels
Variable Value,,Label
Table: Variables
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-a,1,,Scale,Input,8,Right,F8.2,F8.2
-b,2,,Scale,Input,8,Right,F8.2,F8.2
-Ra,3,RANK of a,Scale,Input,8,Right,F9.3,F9.3
-RFR001,4,RFRACTION of a,Scale,Input,8,Right,F6.4,F6.4
+a,1,,Nominal,Input,8,Right,F8.2,F8.2
+b,2,,Nominal,Input,8,Right,F8.2,F8.2
+Ra,3,RANK of a,Ordinal,Input,8,Right,F9.3,F9.3
+RFR001,4,RFRACTION of a,Ordinal,Input,8,Right,F6.4,F6.4
count,5,N of a,Scale,Input,8,Right,F6.0,F6.0
-Rb,6,RANK of b,Scale,Input,8,Right,F9.3,F9.3
-RFR002,7,RFRACTION of b,Scale,Input,8,Right,F6.4,F6.4
+Rb,6,RANK of b,Ordinal,Input,8,Right,F9.3,F9.3
+RFR002,7,RFRACTION of b,Ordinal,Input,8,Right,F6.4,F6.4
Nb,8,N of b,Scale,Input,8,Right,F6.0,F6.0
Table: Data List
Table: Variables
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
-foo,1,,Scale,Input,8,Right,F8.2,F8.2
-rfoo,2,,Scale,Input,8,Right,F8.2,F8.2
-ran003,3,,Scale,Input,8,Right,F8.2,F8.2
-RAN001,4,RANK of foo,Scale,Input,8,Right,F9.3,F9.3
+foo,1,,Nominal,Input,8,Right,F8.2,F8.2
+rfoo,2,,Nominal,Input,8,Right,F8.2,F8.2
+ran003,3,,Nominal,Input,8,Right,F8.2,F8.2
+RAN001,4,RANK of foo,Ordinal,Input,8,Right,F9.3,F9.3
])
AT_CLEANUP
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
string,1,A Short String Variable,Nominal,Input,8,Left,A8,A8,"""3333 """
longstring,2,A Long String Variable,Nominal,Input,12,Left,A12,A12,
-numeric,3,A Numeric Variable,Scale,Input,8,Right,F10.0,F10.0,9; 5; 999
+numeric,3,A Numeric Variable,Nominal,Input,8,Right,F10.0,F10.0,9; 5; 999
date,4,A Date Variable,Scale,Input,8,Right,DATE11,DATE11,
dollar,5,A Dollar Variable,Scale,Input,8,Right,DOLLAR11.2,DOLLAR11.2,
datetime,6,A Datetime Variable,Scale,Input,8,Right,DATETIME17.0,DATETIME17.0,
Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
string,1,A Short String Variable,Nominal,Input,8,Left,A8,A8,"""3333 """
longstring,2,A Long String Variable,Nominal,Input,12,Left,A12,A12,
-numeric,3,A Numeric Variable,Scale,Input,8,Right,F10.0,F10.0,9; 5; 999
+numeric,3,A Numeric Variable,Nominal,Input,8,Right,F10.0,F10.0,9; 5; 999
date,4,A Date Variable,Scale,Input,8,Right,DATE11,DATE11,
dollar,5,A Dollar Variable,Scale,Input,8,Right,DOLLAR11.2,DOLLAR11.2,
datetime,6,A Datetime Variable,Scale,Input,8,Right,DATETIME17.0,DATETIME17.0,