for (i = 0; i < agr.break_var_cnt; i++)
{
struct variable *v = dict_clone_var (agr.dict, agr.break_vars[i],
- agr.break_vars[i]->name);
+ agr.break_vars[i]->name,
+ agr.break_vars[i]->longname
+ );
assert (v != NULL);
}
}
else
{
- agr.writer = sfm_open_writer (out_file, agr.dict, get_scompression ());
+ agr.writer = sfm_open_writer (out_file, agr.dict, get_scompression (), 0);
if (agr.writer == NULL)
goto error;
}
for (function = agr_func_tab; function->name; function++)
- if (!strcmp (function->name, tokid))
+ if (!strcasecmp (function->name, tokid))
break;
if (NULL == function->name)
{
}
if (function->alpha_type == ALPHA)
- destvar = dict_clone_var (agr->dict, v->src, dest[i]);
+ destvar = dict_clone_var (agr->dict, v->src, 0, dest[i] );
else if (v->src->type == NUMERIC
|| function->alpha_type == NUMERIC)
{
destvar = dict_create_var (agr->dict, dest[i], 0);
-
- if ((func_index == N || func_index == NMISS)
- && dict_get_weight (default_dict) != NULL)
- destvar->print = destvar->write = f8_2;
- else
- destvar->print = destvar->write = function->format;
+ if (destvar != NULL)
+ {
+ if ((func_index == N || func_index == NMISS)
+ && dict_get_weight (default_dict) != NULL)
+ destvar->print = destvar->write = f8_2;
+ else
+ destvar->print = destvar->write = function->format;
+ }
}
- else
- destvar = dict_create_var (agr->dict, dest[i],
- v->src->width);
} else {
v->src = NULL;
destvar = dict_create_var (agr->dict, dest[i], 0);
"the aggregate variables and the break "
"variables."),
dest[i]);
- free (dest[i]);
goto error;
}