User manual: Use italic typeface for latin abbreviations
[pspp] / doc / files.texi
index ede6e37d78f050ab3858db482348a44751f97e55..54c26c89b79aac63ec5c2f03dc9caa27cf68ece6 100644 (file)
@@ -20,6 +20,7 @@ portable files.
 * GET DATA::                    Read from foreign files.
 * IMPORT::                      Read from a portable file.
 * SAVE::                        Write to a system file.
+* SAVE DATA COLLECTION::        Write to a system file and metadata file.
 * SAVE TRANSLATE::              Write data in foreign file formats.
 * SYSFILE INFO::                Display system file dictionary.
 * XEXPORT::                     Write to a portable file, as a transformation.
@@ -128,7 +129,7 @@ The @subcmd{OUTFILE} subcommand, which is the only required subcommand, specifie
 the portable file to be written as a file name string or
 a file handle (@pxref{File Handles}).
 
-@subcmd{DROP}, @subcmd{KEEP}, and @subcmd{RENAME} follow the same format as the 
+@subcmd{DROP}, @subcmd{KEEP}, and @subcmd{RENAME} follow the same format as the
 @subcmd{SAVE} procedure (@pxref{SAVE}).
 
 The @subcmd{TYPE} subcommand specifies the character set for use in the
@@ -178,7 +179,7 @@ eliminated.  When this is done, only a single variable may be renamed at
 once.  For instance, @subcmd{/RENAME=@var{A}=@var{B}}.  This alternate syntax is
 deprecated.
 
-@subcmd{DROP}, @subcmd{KEEP}, and @subcmd{RENAME} are executed in left-to-right order.  
+@subcmd{DROP}, @subcmd{KEEP}, and @subcmd{RENAME} are executed in left-to-right order.
 Each may be present any number of times.  @cmd{GET} never modifies a
 file on disk.  Only the active dataset read from the file
 is affected by these subcommands.
@@ -259,17 +260,17 @@ Gnumeric spreadsheets (@url{http://gnumeric.org}), and spreadsheets
 in OpenDocument format
 (@url{http://libreplanet.org/wiki/Group:OpenDocument/Software})
 can be read using the @cmd{GET DATA} command.
-Use the @subcmd{TYPE} subcommand to indicate the file's format.  
+Use the @subcmd{TYPE} subcommand to indicate the file's format.
 /TYPE=GNM indicates Gnumeric files,
 /TYPE=ODS indicates OpenDocument.
 The @subcmd{FILE} subcommand is mandatory.
-Use it to specify the name file to be read. 
+Use it to specify the name file to be read.
 All other subcommands are optional.
 
-The format of each variable is determined by the format of the spreadsheet 
+The format of each variable is determined by the format of the spreadsheet
 cell containing the first datum for the variable.
 If this cell is of string (text) format, then the width of the variable is
-determined from the length of the string it contains, unless the 
+determined from the length of the string it contains, unless the
 @subcmd{ASSUMEDSTRWIDTH} subcommand is given.
 
 The @subcmd{SHEET} subcommand specifies the sheet within the spreadsheet file to read.
@@ -286,9 +287,9 @@ first sheet in the file.
 The @subcmd{CELLRANGE} subcommand specifies the range of cells within the sheet to read.
 If the subcommand is given as @subcmd{/CELLRANGE=FULL}, then the entire
 sheet  is read.
-To read only part of a sheet, use the form 
+To read only part of a sheet, use the form
 @subcmd{/CELLRANGE=range '@var{top_left_cell}:@var{bottom_right_cell}'}.
-For example, the subcommand @subcmd{/CELLRANGE=range 'C3:P19'} reads 
+For example, the subcommand @subcmd{/CELLRANGE=range 'C3:P19'} reads
 columns C--P, and rows 3--19 inclusive.
 If no @subcmd{CELLRANGE} subcommand is given, then the entire sheet is read.
 
@@ -300,7 +301,7 @@ used, then the variables  receive automatically assigned names.
 
 The @subcmd{ASSUMEDSTRWIDTH} subcommand specifies the maximum width of string
 variables read  from the file.
-If omitted, the default value is determined from the length of the 
+If omitted, the default value is determined from the length of the
 string in the first spreadsheet cell for each variable.
 
 
@@ -321,12 +322,12 @@ GET DATA /TYPE=PSQL
 
 The PSQL type is used to import data from a postgres database server.
 The server may be located locally or remotely.
-Variables are automatically created based on the table column names 
+Variables are automatically created based on the table column names
 or the names specified in the SQL query.
-Postgres data types of high precision, will loose precision when 
+Postgres data types of high precision, will loose precision when
 imported into @pspp{}.
 Not all the postgres data types are able to be represented in @pspp{}.
-If a datum cannot be represented a warning will be issued and that 
+If a datum cannot be represented a warning will be issued and that
 datum will be set to SYSMIS.
 
 The @subcmd{CONNECT} subcommand is mandatory.
@@ -340,15 +341,15 @@ It must be a valid SQL string to retrieve data from the database.
 
 The @subcmd{ASSUMEDSTRWIDTH} subcommand specifies the maximum width of string
 variables read  from the database.
-If omitted, the default value is determined from the length of the 
+If omitted, the default value is determined from the length of the
 string in the first value read for each variable.
 
 The @subcmd{UNENCRYPTED} subcommand allows data to be retrieved over an insecure
 connection.
-If the connection is not encrypted, and the @subcmd{UNENCRYPTED} subcommand is 
+If the connection is not encrypted, and the @subcmd{UNENCRYPTED} subcommand is
 not given, then an error will occur.
 Whether or not the connection is
-encrypted depends upon the underlying psql library and the 
+encrypted depends upon the underlying psql library and the
 capabilities of the database server.
 
 The @subcmd{BSIZE} subcommand serves only to optimise the speed of data transfer.
@@ -357,7 +358,7 @@ number of cases to fetch from the database at once.
 The default value is 4096.
 If your SQL statement fetches a large number of cases but only a small number of
 variables, then the data transfer may be faster if you increase this value.
-Conversely, if the number of variables is large, or if the machine on which 
+Conversely, if the number of variables is large, or if the machine on which
 @pspp{} is running has only a
 small amount of memory, then a smaller value will be better.
 
@@ -388,7 +389,7 @@ GET DATA /TYPE=TXT
 When TYPE=TXT is specified, GET DATA reads data in a delimited or
 fixed columnar format, much like DATA LIST (@pxref{DATA LIST}).
 
-The @subcmd{FILE} subcommand is mandatory.  Specify the file to be read as 
+The @subcmd{FILE} subcommand is mandatory.  Specify the file to be read as
 a string file name or (for textual data only) a
 file handle (@pxref{File Handles}).
 
@@ -609,12 +610,12 @@ value is 1.
 The @subcmd{VARIABLES} subcommand, which is required, specifies the positions
 at which each variable can be found.  For each variable, specify its
 name, followed by its start and end column separated by @samp{-}
-(e.g.@: @samp{0-9}), followed by an input format type (e.g.@:
-@samp{F}) or a full format specification (e.g.@: @samp{DOLLAR12.2}).
+(@i{e.g.}@: @samp{0-9}), followed by an input format type (@i{e.g.}@:
+@samp{F}) or a full format specification (@i{e.g.}@: @samp{DOLLAR12.2}).
 For this command, columns are numbered starting from 0 at
 the left column.  Introduce the variables in the second and later
 lines of a case by a slash followed by the number of the line within
-the case, e.g.@: @samp{/2} for the second line.
+the case, @i{e.g.}@: @samp{/2} for the second line.
 
 @subsubheading Examples
 
@@ -747,7 +748,7 @@ Specify, within parentheses, a list of variable names followed by an
 equals sign (@samp{=}) and the names that they should be renamed to.
 Multiple parenthesized groups of variable names can be included on a
 single @subcmd{RENAME} subcommand.  Variables' names may be swapped using a
-@subcmd{RENAME} subcommand of the 
+@subcmd{RENAME} subcommand of the
 form @subcmd{/RENAME=(@var{A} @var{B}=@var{B} @var{A})}.
 
 Alternate syntax for the @subcmd{RENAME} subcommand allows the parentheses to be
@@ -770,6 +771,45 @@ The @subcmd{NAMES} and @subcmd{MAP} subcommands are currently ignored.
 
 @cmd{SAVE} causes the data to be read.  It is a procedure.
 
+@node SAVE DATA COLLECTION
+@section SAVE DATA COLLECTION
+@vindex SAVE DATA COLLECTION
+
+@display
+SAVE DATA COLLECTION
+        /OUTFILE=@{'@var{file_name}',@var{file_handle}@}
+        /METADATA=@{'@var{file_name}',@var{file_handle}@}
+        /@{UNCOMPRESSED,COMPRESSED,ZCOMPRESSED@}
+        /PERMISSIONS=@{WRITEABLE,READONLY@}
+        /DROP=@var{var_list}
+        /KEEP=@var{var_list}
+        /VERSION=@var{version}
+        /RENAME=(@var{src_names}=@var{target_names})@dots{}
+        /NAMES
+        /MAP
+@end display
+
+Like @cmd{SAVE}, @cmd{SAVE DATA COLLECTION} writes the dictionary and
+data in the active dataset to a system file.  In addition, it writes
+metadata to an additional XML metadata file.
+
+OUTFILE is required.  Specify the system file to be written as a
+string file name or a file handle (@pxref{File Handles}).
+
+METADATA is also required.  Specify the metadata file to be written as
+a string file name or a file handle.  Metadata files customarily use a
+@file{.mdd} extension.
+
+The current implementation of this command is experimental.  It only
+outputs an approximation of the metadata file format.  Please report
+bugs.
+
+Other subcommands are optional.  They have the same meanings as in the
+@cmd{SAVE} command.
+
+@cmd{SAVE DATA COLLECTION} causes the data to be read.  It is a
+procedure.
+
 @node SAVE TRANSLATE
 @section SAVE TRANSLATE
 @vindex SAVE TRANSLATE
@@ -910,7 +950,7 @@ qualifier character that appears within a value is doubled.
 @section SYSFILE INFO
 @vindex SYSFILE INFO
 
-@display 
+@display
 SYSFILE INFO FILE='@var{file_name}' [ENCODING='@var{encoding}'].
 @end display