- const struct variable *var = lcmd->v_variables[i];
- struct table *c;
-
- c = table_from_casereader (group, i, var_get_name (var),
- var_get_print_format (var));
- t = table_hpaste (t, c);
+ int case_idx = pivot_category_create_leaf (
+ cases->root, pivot_value_new_integer (case_num));
+ case_num += lcmd->step;
+
+ for (int i = 0; i < lcmd->n_variables; i++)
+ pivot_table_put2 (table, i, case_idx,
+ pivot_value_new_var_value (
+ lcmd->v_variables[i], case_data_idx (c, i)));