- printf (_("\nVariables in dictionary:\n"));
- for (i = 0; i < dict->nvar; i++)
- printf ("%s, ", dict->var[i]->name);
- printf ("\n");
+ proc = xmalloc (sizeof *proc);
+ proc->writer = NULL;
+ proc->map = NULL;
+ case_nullify (&proc->bounce);
+
+ lex_match ('/');
+ if (lex_match_id ("OUTFILE"))
+ lex_match ('=');
+ fh = fh_parse ();
+ if (fh == NULL)
+ return CMD_FAILURE;
+
+ dict = dict_clone (default_dict);
+ start_case_map (dict);
+ if (!trim_dictionary (dict, OP_EXPORT, NULL))
+ goto error;
+ proc->map = finish_case_map (dict);
+ if (proc->map != NULL)
+ case_create (&proc->bounce, dict_get_next_value_idx (dict));
+
+ proc->writer = pfm_open_writer (fh, dict);
+ if (proc->writer == NULL)
+ goto error;
+
+ dict_destroy (dict);
+
+ procedure (export_write_case_func, proc);
+ export_proc_free (proc);
+ free (proc);
+
+ return CMD_SUCCESS;
+
+ error:
+ dict_destroy (dict);
+ export_proc_free (proc);
+ free (proc);
+ return CMD_FAILURE;