1 @node System and Portable Files
2 @chapter System Files and Portable Files
4 The commands in this chapter read, write, and examine system files and
8 * APPLY DICTIONARY:: Apply system file dictionary to active file.
9 * EXPORT:: Write to a portable file.
10 * GET:: Read from a system file.
11 * GET DATA:: Read from foreign files.
12 * IMPORT:: Read from a portable file.
13 * MATCH FILES:: Merge system files.
14 * SAVE:: Write to a system file.
15 * SYSFILE INFO:: Display system file dictionary.
16 * XEXPORT:: Write to a portable file, as a transformation.
17 * XSAVE:: Write to a system file, as a transformation.
20 @node APPLY DICTIONARY
21 @section APPLY DICTIONARY
22 @vindex APPLY DICTIONARY
25 APPLY DICTIONARY FROM=@{'file-name',file_handle@}.
28 @cmd{APPLY DICTIONARY} applies the variable labels, value labels,
29 and missing values taken from a file to corresponding
30 variables in the active file. In some cases it also updates the
33 Specify a system file, portable file, or scratch file with a file name
34 string or as a file handle (@pxref{File Handles}). The dictionary in the
35 file will be read, but it will not replace the active file dictionary.
36 The file's data will not be read.
38 Only variables with names that exist in both the active file and the
39 system file are considered. Variables with the same name but different
40 types (numeric, string) will cause an error message. Otherwise, the
41 system file variables' attributes will replace those in their matching
42 active file variables, as described below.
44 If a system file variable has a variable label, then it will replace the
45 active file variable's variable label. If the system file variable does
46 not have a variable label, then the active file variable's variable
47 label, if any, will be retained.
49 If the active file variable is numeric or short string, then value
50 labels and missing values, if any, will be copied to the active file
51 variable. If the system file variable does not have value labels or
52 missing values, then those in the active file variable, if any, will not
55 Finally, weighting of the active file is updated (@pxref{WEIGHT}). If
56 the active file has a weighting variable, and the system file does not,
57 or if the weighting variable in the system file does not exist in the
58 active file, then the active file weighting variable, if any, is
59 retained. Otherwise, the weighting variable in the system file becomes
60 the active file weighting variable.
62 @cmd{APPLY DICTIONARY} takes effect immediately. It does not read the
64 file. The system file is not modified.
73 /UNSELECTED=@{RETAIN,DELETE@}
77 /RENAME=(src_names=target_names)@dots{}
82 The @cmd{EXPORT} procedure writes the active file dictionary and data to a
83 specified portable file or scratch file.
85 By default, cases excluded with FILTER are written to the
86 file. These can be excluded by specifying DELETE on the UNSELECTED
87 subcommand. Specifying RETAIN makes the default explicit.
89 Portable files express real numbers in base 30. Integers are always
90 expressed to the maximum precision needed to make them exact.
91 Non-integers are, by default, expressed to the machine's maximum
92 natural precision (approximately 15 decimal digits on many machines).
93 If many numbers require this many digits, the portable file may
94 significantly increase in size. As an alternative, the DIGITS
95 subcommand may be used to specify the number of decimal digits of
96 precision to write. DIGITS applies only to non-integers.
98 The OUTFILE subcommand, which is the only required subcommand, specifies
99 the portable file or scratch file to be written as a file name string or
100 a file handle (@pxref{File Handles}).
102 DROP, KEEP, and RENAME follow the same format as the SAVE procedure
105 The TYPE subcommand specifies the character set for use in the
106 portable file. Its value is currently not used.
108 The MAP subcommand is currently ignored.
110 @cmd{EXPORT} is a procedure. It causes the active file to be read.
118 /FILE=@{'file-name',file_handle@}
121 /RENAME=(src_names=target_names)@dots{}
124 @cmd{GET} clears the current dictionary and active file and
125 replaces them with the dictionary and data from a specified file.
127 The FILE subcommand is the only required subcommand. Specify the system
128 file, portable file, or scratch file to be read as a string file name or
129 a file handle (@pxref{File Handles}).
131 By default, all the variables in a file are read. The DROP
132 subcommand can be used to specify a list of variables that are not to be
133 read. By contrast, the KEEP subcommand can be used to specify variable
134 that are to be read, with all other variables not read.
136 Normally variables in a file retain the names that they were
137 saved under. Use the RENAME subcommand to change these names. Specify,
138 within parentheses, a list of variable names followed by an equals sign
139 (@samp{=}) and the names that they should be renamed to. Multiple
140 parenthesized groups of variable names can be included on a single
141 RENAME subcommand. Variables' names may be swapped using a RENAME
142 subcommand of the form @samp{/RENAME=(A B=B A)}.
144 Alternate syntax for the RENAME subcommand allows the parentheses to be
145 eliminated. When this is done, only a single variable may be renamed at
146 once. For instance, @samp{/RENAME=A=B}. This alternate syntax is
149 DROP, KEEP, and RENAME are executed in left-to-right order.
150 Each may be present any number of times. @cmd{GET} never modifies a
151 file on disk. Only the active file read from the file
152 is affected by these subcommands.
154 @cmd{GET} does not cause the data to be read, only the dictionary. The data
155 is read later, when a procedure is executed.
157 Use of @cmd{GET} to read a portable file or scratch file is a PSPP
166 /TYPE=@{GNM,PSQL,TXT@}
167 @dots{}additional subcommands depending on TYPE@dots{}
170 The @cmd{GET DATA} command is used to read files and other data sources
171 created by other applications.
172 When this command is executed, the current dictionary and active file are
173 replaced with variables and data read from the specified source.
175 The TYPE subcommand is mandatory and must be the first subcommand
176 specified. It determines the type of the file or source to read.
177 PSPP currently supports the following file types:
181 Spreadsheet files created by Gnumeric (@url{http://gnumeric.org}).
184 Relations from PostgreSQL databases (@url{http://postgresql.org}).
187 Textual data files in columnar and delimited formats.
190 Each supported file type has additional subcommands, explained in
191 separate sections below.
194 * GET DATA /TYPE=GNM::
195 * GET DATA /TYPE=PSQL::
196 * GET DATA /TYPE=TXT::
199 @node GET DATA /TYPE=GNM
200 @subsection Gnumeric Spreadsheet Files
204 /FILE=@{'file-name'@}
205 /SHEET=@{NAME 'sheet-name', INDEX n@}
206 /CELLRANGE=@{RANGE 'range', FULL@}
207 /READNAMES=@{ON, OFF@}
212 @cindex spreadsheet files
213 To use GET DATA to read a spreadsheet file created by Gnumeric
214 (@url{http://gnumeric.org}), specify TYPE=GNM to indicate the file's
215 format and use FILE to indicate the Gnumeric file to be read. All
216 other subcommands are optional.
218 The format of each variable is determined by the format of the spreadsheet
219 cell containing the first datum for the variable.
220 If this cell is of string (text) format, then the width of the variable is
221 determined from the length of the string it contains, unless the
222 ASSUMEDVARWIDTH subcommand is given.
225 The FILE subcommand is mandatory. Specify the name of the file
228 The SHEET subcommand specifies the sheet within the spreadsheet file to read.
229 There are two forms of the SHEET subcommand.
231 @samp{/SHEET=name @var{sheet-name}}, the string @var{sheet-name} is the
232 name of the sheet to read.
233 In the second form, @samp{/SHEET=index @var{idx}}, @var{idx} is a
234 integer which is the index of the sheet to read.
235 The first sheet has the index 1.
236 If the SHEET subcommand is omitted, then the command will read the
237 first sheet in the file.
239 The CELLRANGE subcommand specifies the range of cells within the sheet to read.
240 If the subcommand is given as @samp{/CELLRANGE=FULL}, then the entire
242 To read only part of a sheet, use the form
243 @samp{/CELLRANGE=range '@var{top-left-cell}:@var{bottom-right-cell}'}.
244 For example, the subcommand @samp{/CELLRANGE=range 'C3:P19'} reads
245 columns C--P, and rows 3--19 inclusive.
246 If no CELLRANGE subcommand is given, then the entire sheet is read.
248 If @samp{/READNAMES=ON} is specified, then the contents of cells of
249 the first row are used as the names of the variables in which to store
250 the data from subsequent rows.
251 If the READNAMES command is omitted, or if @samp{/READNAMES=OFF} is
252 used, then the variables receive automatically assigned names.
254 The ASSUMEDVARWIDTH subcommand specifies the maximum width of string
255 variables read from the file.
256 If omitted, the default value is determined from the length of the
257 string in the first spreadsheet cell for each variable.
260 @node GET DATA /TYPE=PSQL
261 @subsection Postgres Database Queries
265 /CONNECT=@{connection info@}
275 The PSQL type is used to import data from a postgres database server.
276 The server may be located locally or remotely.
277 Variables are automatically created based on the table column names
278 or the names specified in the SQL query.
279 Postgres data types of high precision, will loose precision when
281 Not all the postgres data types are able to be represented in PSPP.
282 If a datum cannot be represented a warning will be issued and that
283 datum will be set to SYSMIS.
285 The CONNECT subcommand is mandatory.
286 It is a string specifying the parameters of the database server from
287 which the data should be fetched.
288 The format of the string is given in the postgres manual
289 @url{http://www.postgresql.org/docs/8.0/static/libpq.html#LIBPQ-CONNECT}.
291 The SQL subcommand is mandatory.
292 It must be a valid SQL string to retrieve data from the database.
294 The ASSUMEDVARWIDTH subcommand specifies the maximum width of string
295 variables read from the database.
296 If omitted, the default value is determined from the length of the
297 string in the first value read for each variable.
299 The UNENCRYPTED subcommand allows data to be retrieved over an insecure
301 If the connection is not encrypted, and the UNENCRYPTED subcommand is not
302 given, then an error will occur.
303 Whether or not the connection is
304 encrypted depends upon the underlying psql library and the
305 capabilities of the database server.
307 The BSIZE subcommand serves only to optimise the speed of data transfer.
308 It specifies an upper limit on
309 number of cases to fetch from the database at once.
310 The default value is 4096.
311 If your SQL statement fetches a large number of cases but only a small number of
312 variables, then the data transfer may be faster if you increase this value.
313 Conversely, if the number of variables is large, or if the machine on which
314 PSPP is running has only a
315 small amount of memory, then a smaller value will be better.
318 The following syntax is an example:
321 /CONNECT='host=example.com port=5432 dbname=product user=fred passwd=xxxx'
322 /SQL='select * from manufacturer'.
326 @node GET DATA /TYPE=TXT
327 @subsection Textual Data Files
331 /FILE=@{'file-name',file_handle@}
332 [/ARRANGEMENT=@{DELIMITED,FIXED@}]
333 [/FIRSTCASE=@{first_case@}]
334 [/IMPORTCASE=@{ALL,FIRST max_cases,PERCENT percent@}]
335 @dots{}additional subcommands depending on ARRANGEMENT@dots{}
340 When TYPE=TXT is specified, GET DATA reads data in a delimited or
341 fixed columnar format, much like DATA LIST (@pxref{DATA LIST}).
343 The FILE subcommand is mandatory. Specify the file to be read as
344 a string file name or (for textual data
345 only) a file handle (@pxref{File Handles}).
347 The ARRANGEMENT subcommand determines the file's basic format.
348 DELIMITED, the default setting, specifies that fields in the input
349 data are separated by spaces, tabs, or other user-specified
350 delimiters. FIXED specifies that fields in the input data appear at
351 particular fixed column positions within records of a case.
353 By default, cases are read from the input file starting from the first
354 line. To skip lines at the beginning of an input file, set FIRSTCASE
355 to the number of the first line to read: 2 to skip the first line, 3
356 to skip the first two lines, and so on.
358 IMPORTCASE can be used to limit the number of cases read from the
359 input file. With the default setting, ALL, all cases in the file are
360 read. Specify FIRST @i{max_cases} to read at most @i{max_cases} cases
361 from the file. Use PERCENT @i{percent} to read only @i{percent}
362 percent, approximately, of the cases contained in the file. (The
363 percentage is approximate, because there is no way to accurately count
364 the number of cases in the file without reading the entire file. The
365 number of cases in some kinds of unusual files cannot be estimated;
366 PSPP will read all cases in such files.)
368 FIRSTCASE and IMPORTCASE may be used with delimited and fixed-format
369 data. The remaining subcommands, which apply only to one of the two file
370 arrangements, are described below.
373 * GET DATA /TYPE=TXT /ARRANGEMENT=DELIMITED::
374 * GET DATA /TYPE=TXT /ARRANGEMENT=FIXED::
377 @node GET DATA /TYPE=TXT /ARRANGEMENT=DELIMITED
378 @subsubsection Reading Delimited Data
382 /FILE=@{'file-name',file_handle@}
383 [/ARRANGEMENT=@{DELIMITED,FIXED@}]
384 [/FIRSTCASE=@{first_case@}]
385 [/IMPORTCASE=@{ALL,FIRST max_cases,PERCENT percent@}]
387 /DELIMITERS="delimiters"
388 [/QUALIFIER="quotes" [/ESCAPE]]
389 [/DELCASE=@{LINE,VARIABLES n_variables@}]
390 /VARIABLES=del_var [del_var]@dots{}
391 where each del_var takes the form:
395 The GET DATA command with TYPE=TXT and ARRANGEMENT=DELIMITED reads
396 input data from text files in delimited format, where fields are
397 separated by a set of user-specified delimiters. Its capabilities are
398 similar to those of DATA LIST FREE (@pxref{DATA LIST FREE}), with a
401 The required FILE subcommand and optional FIRSTCASE and IMPORTCASE
402 subcommands are described above (@pxref{GET DATA /TYPE=TXT}).
404 DELIMITERS, which is required, specifies the set of characters that
405 may separate fields. Each character in the string specified on
406 DELIMITERS separates one field from the next. The end of a line also
407 separates fields, regardless of DELIMITERS. Two consecutive
408 delimiters in the input yield an empty field, as does a delimiter at
409 the end of a line. A space character as a delimiter is an exception:
410 consecutive spaces do not yield an empty field and neither does any
411 number of spaces at the end of a line.
413 To use a tab as a delimiter, specify @samp{\t} at the beginning of the
414 DELIMITERS string. To use a backslash as a delimiter, specify
415 @samp{\\} as the first delimiter or, if a tab should also be a
416 delimiter, immediately following @samp{\t}. To read a data file in
417 which each field appears on a separate line, specify the empty string
420 The optional QUALIFIER subcommand names one or more characters that
421 can be used to quote values within fields in the input. A field that
422 begins with one of the specified quote characters ends at the next
423 matching quote. Intervening delimiters become part of the field,
424 instead of terminating it. The ability to specify more than one quote
425 character is a PSPP extension.
427 By default, a character specified on QUALIFIER cannot itself be
428 embedded within a field that it quotes, because the quote character
429 always terminates the quoted field. With ESCAPE, however, a doubled
430 quote character within a quoted field inserts a single instance of the
431 quote into the field. For example, if @samp{'} is specified on
432 QUALIFIER, then without ESCAPE @code{'a''b'} specifies a pair of
433 fields that contain @samp{a} and @samp{b}, but with ESCAPE it
434 specifies a single field that contains @samp{a'b}. ESCAPE is a PSPP
437 The DELCASE subcommand controls how data may be broken across lines in
438 the data file. With LINE, the default setting, each line must contain
439 all the data for exactly one case. For additional flexibility, to
440 allow a single case to be split among lines or multiple cases to be
441 contained on a single line, specify VARIABLES @i{n_variables}, where
442 @i{n_variables} is the number of variables per case.
444 The VARIABLES subcommand is required and must be the last subcommand.
445 Specify the name of each variable and its input format (@pxref{Input
446 and Output Formats}) in the order they should be read from the input
449 @subsubheading Examples
452 On a Unix-like system, the @samp{/etc/passwd} file has a format
456 root:$1$nyeSP5gD$pDq/:0:0:,,,:/root:/bin/bash
457 blp:$1$BrP/pFg4$g7OG:1000:1000:Ben Pfaff,,,:/home/blp:/bin/bash
458 john:$1$JBuq/Fioq$g4A:1001:1001:John Darrington,,,:/home/john:/bin/bash
459 jhs:$1$D3li4hPL$88X1:1002:1002:Jason Stover,,,:/home/jhs:/bin/csh
463 The following syntax reads a file in the format used by
466 @c If you change this example, change the regression test in
467 @c tests/command/get-data-txt-examples.sh to match.
469 GET DATA /TYPE=TXT /FILE='/etc/passwd' /DELIMITERS=':'
470 /VARIABLES=username A20
480 Consider the following data on used cars:
483 model year mileage price type age
484 Civic 2002 29883 15900 Si 2
485 Civic 2003 13415 15900 EX 1
486 Civic 1992 107000 3800 n/a 12
487 Accord 2002 26613 17900 EX 1
491 The following syntax can be used to read the used car data:
493 @c If you change this example, change the regression test in
494 @c tests/command/get-data-txt-examples.sh to match.
496 GET DATA /TYPE=TXT /FILE='cars.data' /DELIMITERS=' ' /FIRSTCASE=2
506 Consider the following information on animals in a pet store:
509 'Pet''s Name', "Age", "Color", "Date Received", "Price", "Height", "Type"
510 , (Years), , , (Dollars), ,
511 "Rover", 4.5, Brown, "12 Feb 2004", 80, '1''4"', "Dog"
512 "Charlie", , Gold, "5 Apr 2007", 12.3, "3""", "Fish"
513 "Molly", 2, Black, "12 Dec 2006", 25, '5"', "Cat"
514 "Gilly", , White, "10 Apr 2007", 10, "3""", "Guinea Pig"
518 The following syntax can be used to read the pet store data:
520 @c If you change this example, change the regression test in
521 @c tests/command/get-data-txt-examples.sh to match.
523 GET DATA /TYPE=TXT /FILE='pets.data' /DELIMITERS=', ' /QUALIFIER='''"' /ESCAPE
534 @node GET DATA /TYPE=TXT /ARRANGEMENT=FIXED
535 @subsubsection Reading Fixed Columnar Data
539 /FILE=@{'file-name',file_handle@}
540 [/ARRANGEMENT=@{DELIMITED,FIXED@}]
541 [/FIRSTCASE=@{first_case@}]
542 [/IMPORTCASE=@{ALL,FIRST max_cases,PERCENT percent@}]
545 /VARIABLES fixed_var [fixed_var]@dots{}
546 [/rec# fixed_var [fixed_var]@dots{}]@dots{}
547 where each fixed_var takes the form:
548 variable start-end format
551 The GET DATA command with TYPE=TXT and ARRANGEMENT=FIXED reads input
552 data from text files in fixed format, where each field is located in
553 particular fixed column positions within records of a case. Its
554 capabilities are similar to those of DATA LIST FIXED (@pxref{DATA LIST
555 FIXED}), with a few enhancements.
557 The required FILE subcommand and optional FIRSTCASE and IMPORTCASE
558 subcommands are described above (@pxref{GET DATA /TYPE=TXT}).
560 The optional FIXCASE subcommand may be used to specify the positive
561 integer number of input lines that make up each case. The default
564 The VARIABLES subcommand, which is required, specifies the positions
565 at which each variable can be found. For each variable, specify its
566 name, followed by its start and end column separated by @samp{-}
567 (e.g.@: @samp{0-9}), followed by the input format type (e.g.@:
568 @samp{F}). For this command, columns are numbered starting from 0 at
569 the left column. Introduce the variables in the second and later
570 lines of a case by a slash followed by the number of the line within
571 the case, e.g.@: @samp{/2} for the second line.
573 @subsubheading Examples
576 Consider the following data on used cars:
579 model year mileage price type age
580 Civic 2002 29883 15900 Si 2
581 Civic 2003 13415 15900 EX 1
582 Civic 1992 107000 3800 n/a 12
583 Accord 2002 26613 17900 EX 1
587 The following syntax can be used to read the used car data:
589 @c If you change this example, change the regression test in
590 @c tests/command/get-data-txt-examples.sh to match.
592 GET DATA /TYPE=TXT /FILE='cars.data' /ARRANGEMENT=FIXED /FIRSTCASE=2
593 /VARIABLES=model 0-7 A
611 /RENAME=(src_names=target_names)@dots{}
614 The @cmd{IMPORT} transformation clears the active file dictionary and
616 replaces them with a dictionary and data from a system, portable file,
619 The FILE subcommand, which is the only required subcommand, specifies
620 the portable file to be read as a file name string or a file handle
621 (@pxref{File Handles}).
623 The TYPE subcommand is currently not used.
625 DROP, KEEP, and RENAME follow the syntax used by @cmd{GET} (@pxref{GET}).
627 @cmd{IMPORT} does not cause the data to be read, only the dictionary. The
628 data is read later, when a procedure is executed.
630 Use of @cmd{IMPORT} to read a system file or scratch file is a PSPP
639 /@{FILE,TABLE@}=@{*,'file-name'@}
640 /RENAME=(src_names=target_names)@dots{}
651 @cmd{MATCH FILES} merges one or more system, portable, or scratch files,
653 including the active file. Cases with the same values for BY
654 variables are combined into a single case. Cases with different
655 values are output in order. Thus, multiple sorted files are
656 combined into a single sorted file based on the value of the BY
657 variables. The results of the merge become the new active file.
659 Specify FILE with a system, portable, or scratch file as a file name
660 string or file handle
661 (@pxref{File Handles}), or with an asterisk (@samp{*}) to
662 indicate the current active file. The files specified on FILE are
663 merged together based on the BY variables, or combined case-by-case if
666 Specify TABLE with a file to use it as a @dfn{table
667 lookup file}. Cases in table lookup files are not used up after
668 they've been used once. This means that data in table lookup files can
669 correspond to any number of cases in FILE files. Table lookup files
670 correspond to lookup tables in traditional relational database systems.
671 If a table lookup file contains more than one case with a given set of
672 BY variables, only the first case is used.
674 Any number of FILE and TABLE subcommands may be specified.
675 Ordinarily, at least two FILE subcommands, or one FILE and at least
676 one TABLE, should be specified. Each instance of FILE or TABLE can be
677 followed by any sequence of RENAME subcommands. These have the same
678 form and meaning as the corresponding subcommands of @cmd{GET}
679 (@pxref{GET}), but apply only to variables in the given file.
681 Each FILE or TABLE may optionally be followed by an IN subcommand,
682 which creates a numeric variable with the specified name and format
683 F1.0. The IN variable takes value 1 in a case if the given file
684 contributed a row to the merged file, 0 otherwise. The DROP, KEEP,
685 and RENAME subcommands do not affect IN variables.
687 When more than one FILE or TABLE contains a variable with a given
688 name, those variables must all have the same type (numeric or string)
689 and, for string variables, the same width. This rules applies to
690 variable names after renaming with RENAME; thus, RENAME can be used to
693 FILE and TABLE must be specified at the beginning of the command, with
694 any RENAME or IN specifications immediately after the corresponding
695 FILE or TABLE. These subcommands are followed by BY, DROP, KEEP,
696 FIRST, LAST, and MAP.
698 The BY subcommand specifies a list of variables that are used to match
699 cases from each of the files. When TABLE or IN is used, BY is
700 required; otherwise, it is optional. When BY is specified, all the
701 files named on FILE and TABLE subcommands must be sorted in ascending
702 order of the BY variables. Variables belonging to files that are not
703 present for the current case are set to the system-missing value for
704 numeric variables or spaces for string variables.
706 The DROP and KEEP subcommands allow variables to be dropped from or
707 reordered within the new active file. These subcommands have the same
708 form and meaning as the corresponding subcommands of @cmd{GET}
709 (@pxref{GET}). They apply to the new active file as a whole, not to
710 individual input files. The variable names specified on DROP and KEEP
711 are those after any renaming with RENAME.
713 The optional FIRST and LAST subcommands name variables that @cmd{MATCH
714 FILES} adds to the active file. The new variables are numeric with
715 print and write format F1.0. The value of the FIRST variable is 1 in
716 the first case with a given set of values for the BY variables, and 0
717 in other cases. Similarly, the LAST variable is 1 in the last case
718 with a given of BY values, and 0 in other cases.
720 @cmd{MATCH FILES} may not be specified following @cmd{TEMPORARY}
721 (@pxref{TEMPORARY}) if the active file is used as an input source.
723 Use of portable or scratch files on @cmd{MATCH FILES} is a PSPP
732 /OUTFILE=@{'file-name',file_handle@}
733 /UNSELECTED=@{RETAIN,DELETE@}
734 /@{COMPRESSED,UNCOMPRESSED@}
735 /PERMISSIONS=@{WRITEABLE,READONLY@}
739 /RENAME=(src_names=target_names)@dots{}
744 The @cmd{SAVE} procedure causes the dictionary and data in the active
746 be written to a system file or scratch file.
748 OUTFILE is the only required subcommand. Specify the system file or
749 scratch file to be written as a string file name or a file handle
750 (@pxref{File Handles}).
752 By default, cases excluded with FILTER are written to the system file.
753 These can be excluded by specifying DELETE on the UNSELECTED
754 subcommand. Specifying RETAIN makes the default explicit.
756 The COMPRESS and UNCOMPRESS subcommand determine whether the saved
757 system file is compressed. By default, system files are compressed.
758 This default can be changed with the SET command (@pxref{SET}).
760 The PERMISSIONS subcommand specifies permissions for the new system
761 file. WRITEABLE, the default, creates the file with read and write
762 permission. READONLY creates the file for read-only access.
764 By default, all the variables in the active file dictionary are written
765 to the system file. The DROP subcommand can be used to specify a list
766 of variables not to be written. In contrast, KEEP specifies variables
767 to be written, with all variables not specified not written.
769 Normally variables are saved to a system file under the same names they
770 have in the active file. Use the RENAME subcommand to change these names.
771 Specify, within parentheses, a list of variable names followed by an
772 equals sign (@samp{=}) and the names that they should be renamed to.
773 Multiple parenthesized groups of variable names can be included on a
774 single RENAME subcommand. Variables' names may be swapped using a
775 RENAME subcommand of the form @samp{/RENAME=(A B=B A)}.
777 Alternate syntax for the RENAME subcommand allows the parentheses to be
778 eliminated. When this is done, only a single variable may be renamed at
779 once. For instance, @samp{/RENAME=A=B}. This alternate syntax is
782 DROP, KEEP, and RENAME are performed in left-to-right order. They
783 each may be present any number of times. @cmd{SAVE} never modifies
784 the active file. DROP, KEEP, and RENAME only affect the system file
787 The VERSION subcommand specifies the version of the file format. Valid
788 versions are 2 and 3. The default version is 3. In version 2 system
789 files, variable names longer than 8 bytes will be truncated. The two
790 versions are otherwise identical.
792 The NAMES and MAP subcommands are currently ignored.
794 @cmd{SAVE} causes the data to be read. It is a procedure.
797 @section SYSFILE INFO
801 SYSFILE INFO FILE='file-name'.
804 @cmd{SYSFILE INFO} reads the dictionary in a system file and
805 displays the information in its dictionary.
807 Specify a file name or file handle. @cmd{SYSFILE INFO} reads that file as
808 a system file and displays information on its dictionary.
810 @cmd{SYSFILE INFO} does not affect the current active file.
822 /RENAME=(src_names=target_names)@dots{}
827 The @cmd{EXPORT} transformation writes the active file dictionary and
828 data to a specified portable file.
830 This transformation is a PSPP extension.
832 It is similar to the @cmd{EXPORT} procedure, with two differences:
836 @cmd{XEXPORT} is a transformation, not a procedure. It is executed when
837 the data is read by a procedure or procedure-like command.
840 @cmd{XEXPORT} does not support the UNSELECTED subcommand.
843 @xref{EXPORT}, for more information.
852 /@{COMPRESSED,UNCOMPRESSED@}
853 /PERMISSIONS=@{WRITEABLE,READONLY@}
857 /RENAME=(src_names=target_names)@dots{}
862 The @cmd{XSAVE} transformation writes the active file dictionary and
863 data to a system file or scratch file. It is similar to the @cmd{SAVE}
864 procedure, with two differences:
868 @cmd{XSAVE} is a transformation, not a procedure. It is executed when
869 the data is read by a procedure or procedure-like command.
872 @cmd{XSAVE} does not support the UNSELECTED subcommand.
875 @xref{SAVE}, for more information.