63a26196688d5ef7a9d307daf09e86bc85266786
[pspp-builds.git] / doc / utilities.texi
1 @node Utilities, Not Implemented, Statistics, Top
2 @chapter Utilities
3
4 Commands that don't fit any other category are placed here.
5
6 Most of these commands are not affected by commands like @cmd{IF} and
7 @cmd{LOOP}:
8 they take effect only once, unconditionally, at the time that they are
9 encountered in the input.
10
11 @menu
12 * COMMENT::                     Document your syntax file.
13 * DOCUMENT::                    Document the active file.
14 * DISPLAY DOCUMENTS::           Display active file documents.
15 * DISPLAY FILE LABEL::          Display the active file label.
16 * DROP DOCUMENTS::              Remove documents from the active file.
17 * ECHO::                        Write a string to the output stream.
18 * ERASE::                       Erase a file.
19 * EXECUTE::                     Execute pending transformations.
20 * FILE LABEL::                  Set the active file's label.
21 * FINISH::                      Terminate the PSPP session.
22 * HOST::                        Temporarily return to the operating system.
23 * INCLUDE::                     Include a file within the current one.
24 * PERMISSIONS::                 Change permissions on a file.
25 * QUIT::                        Terminate the PSPP session.
26 * SET::                         Adjust PSPP runtime parameters.
27 * SHOW::                        Display runtime parameters.
28 * SUBTITLE::                    Provide a document subtitle.
29 * TITLE::                       Provide a document title.
30 @end menu
31
32 @node COMMENT, DOCUMENT, Utilities, Utilities
33 @section COMMENT
34 @vindex COMMENT
35 @vindex *
36
37 @display 
38 Two possibles syntaxes:
39         COMMENT comment text @dots{} .
40         *comment text @dots{} .
41 @end display
42
43 @cmd{COMMENT} is ignored.  It is used to provide information to
44 the author and other readers of the PSPP syntax file.  
45
46 @cmd{COMMENT} can extend over any number of lines.  Don't forget to
47 terminate it with a dot or a blank line.
48
49 @node DOCUMENT, DISPLAY DOCUMENTS, COMMENT, Utilities
50 @section DOCUMENT
51 @vindex DOCUMENT
52
53 @display
54 DOCUMENT documentary_text.
55 @end display
56
57 @cmd{DOCUMENT} adds one or more lines of descriptive commentary to the
58 active file.  Documents added in this way are saved to system files.
59 They can be viewed using @cmd{SYSFILE INFO} or @cmd{DISPLAY
60 DOCUMENTS}.  They can be removed from the active file with @cmd{DROP
61 DOCUMENTS}.
62
63 Specify the documentary text following the DOCUMENT keyword.  You can
64 extend the documentary text over as many lines as necessary.  Lines are
65 truncated at 80 characters width.  Don't forget to terminate
66 the command with a dot or a blank line.
67
68 @node DISPLAY DOCUMENTS, DISPLAY FILE LABEL, DOCUMENT, Utilities
69 @section DISPLAY DOCUMENTS
70 @vindex DISPLAY DOCUMENTS
71
72 @display
73 DISPLAY DOCUMENTS.
74 @end display
75
76 @cmd{DISPLAY DOCUMENTS} displays the documents in the active file.  Each
77 document is preceded by a line giving the time and date that it was
78 added.  @xref{DOCUMENT}.
79
80 @node DISPLAY FILE LABEL, DROP DOCUMENTS, DISPLAY DOCUMENTS, Utilities
81 @section DISPLAY FILE LABEL
82 @vindex DISPLAY FILE LABEL
83
84 @display
85 DISPLAY FILE LABEL.
86 @end display
87
88 @cmd{DISPLAY FILE LABEL} displays the file label contained in the
89 active file,
90 if any.  @xref{FILE LABEL}.
91
92 @node DROP DOCUMENTS, ECHO, DISPLAY FILE LABEL, Utilities
93 @section DROP DOCUMENTS
94 @vindex DROP DOCUMENTS
95
96 @display
97 DROP DOCUMENTS.
98 @end display
99
100 @cmd{DROP DOCUMENTS} removes all documents from the active file.
101 New documents can be added with @cmd{DOCUMENT} (@pxref{DOCUMENT}).
102
103 @cmd{DROP DOCUMENTS} changes only the active file.  It does not modify any
104 system files stored on disk.
105
106 @node ECHO, ERASE, DROP DOCUMENTS, Utilities
107 @section ECHO
108 @vindex ECHO
109
110 @display 
111 ECHO 'arbitrary text' .
112 @end display
113
114 Use @cmd{ECHO} to write arbitrary text to the output stream. The text should be enclosed in quotation marks following the normal rules for string tokens (@pxref{Tokens}).
115
116 @node ERASE, EXECUTE, ECHO, Utilities
117 @comment  node-name,  next,  previous,  up
118 @section ERASE
119 @vindex ERASE
120
121 @display
122 ERASE FILE file_name.
123 @end display
124
125 @cmd{ERASE FILE} deletes a file from the local filesystem.
126 file_name must be quoted.
127 This command cannot be used if the SAFER setting is active.
128
129
130 @node EXECUTE, FILE LABEL, ERASE, Utilities
131 @section EXECUTE
132 @vindex EXECUTE
133
134 @display
135 EXECUTE.
136 @end display
137
138 @cmd{EXECUTE} causes the active file to be read and all pending
139 transformations to be executed.
140
141 @node FILE LABEL, FINISH, EXECUTE, Utilities
142 @section FILE LABEL
143 @vindex FILE LABEL
144
145 @display
146 FILE LABEL file_label.
147 @end display
148
149 @cmd{FILE LABEL} provides a title for the active file.  This
150 title will be saved into system files and portable files that are
151 created during this PSPP run.
152
153 file_label need not be quoted.  If quotes are
154 included, they become part of the file label.
155
156 @node FINISH, HOST, FILE LABEL, Utilities
157 @section FINISH
158 @vindex FINISH
159
160 @display
161 FINISH.
162 @end display
163
164 @cmd{FINISH} terminates the current PSPP session and returns
165 control to the operating system.
166
167 This command is not valid in interactive mode.
168
169 @node HOST, INCLUDE, FINISH, Utilities
170 @comment  node-name,  next,  previous,  up
171 @section HOST
172 @vindex HOST
173
174 @display
175 HOST.
176 @end display
177
178 @cmd{HOST} suspends the current PSPP session and temporarily returns control 
179 to the operating system.
180 This command cannot be used if the SAFER setting is active.
181
182
183 @node INCLUDE, PERMISSIONS, HOST, Utilities
184 @section INCLUDE
185 @vindex INCLUDE
186 @vindex @@
187
188 @display
189 Two possible syntaxes:
190         INCLUDE 'filename'.
191         @@filename.
192 @end display
193
194 @cmd{INCLUDE} causes the PSPP command processor to read an
195 additional command file as if it were included bodily in the current
196 command file.
197
198 Include files may be nested to any depth, up to the limit of available
199 memory.
200
201 @node PERMISSIONS, QUIT, INCLUDE, Utilities
202 @comment  node-name,  next,  previous,  up
203 @section PERMISSIONS
204 @vindex PERMISSIONS
205 @cindex mode
206 @cindex file mode
207 @cindex changing file permissions
208
209 @display
210 PERMISSIONS
211         FILE='filename'
212         /PERMISSIONS = @{READONLY,WRITEABLE@}.
213 @end display
214
215 @cmd{PERMISSIONS} changes the permissions of a file.  
216 There is one mandatory subcommand which specifies the permissions to
217 which the file should be changed.  
218 If you set a file's  permission  to READONLY, then the file will become
219 unwritable either by you or anyone else on the system.
220 If you set the permission to WRITEABLE, then the file will become
221 writeable by you; the permissions afforded to others will be
222 unchanged.
223 This command cannot be used if the SAFER setting is active.
224
225
226 @node QUIT, SET, PERMISSIONS, Utilities
227 @section QUIT
228 @vindex QUIT
229
230 @display
231 Two possible syntaxes:
232         QUIT.
233         EXIT.
234 @end display
235
236 @cmd{QUIT} terminates the current PSPP session and returns control
237 to the operating system.  
238
239 This command is not valid within a command file.
240
241 @node SET, SHOW, QUIT, Utilities
242 @section SET
243 @vindex SET
244
245 @display
246 SET
247
248 (data input)
249         /BLANKS=@{SYSMIS,'.',number@}
250         /DECIMAL=@{DOT,COMMA@}
251         /FORMAT=fmt_spec
252         /EPOCH=@{AUTOMATIC,year@}
253
254 (program input)
255         /ENDCMD='.'
256         /NULLINE=@{ON,OFF@}
257
258 (interaction)
259         /CPROMPT='cprompt_string'
260         /DPROMPT='dprompt_string'
261         /ERRORBREAK=@{OFF,ON@}
262         /MXERRS=max_errs
263         /MXWARNS=max_warnings
264         /PROMPT='prompt'
265
266 (program execution)
267         /MEXPAND=@{ON,OFF@}
268         /MITERATE=max_iterations
269         /MNEST=max_nest
270         /MPRINT=@{ON,OFF@}
271         /MXLOOPS=max_loops
272         /SEED=@{RANDOM,seed_value@}
273         /UNDEFINED=@{WARN,NOWARN@}
274
275 (data output)
276         /CC@{A,B,C,D,E@}=@{'npre,pre,suf,nsuf','npre.pre.suf.nsuf'@}
277         /DECIMAL=@{DOT,COMMA@}
278         /FORMAT=fmt_spec
279
280 (output routing)
281         /ECHO=@{ON,OFF@}
282         /ERRORS=@{ON,OFF,TERMINAL,LISTING,BOTH,NONE@}
283         /INCLUDE=@{ON,OFF@}
284         /MESSAGES=@{ON,OFF,TERMINAL,LISTING,BOTH,NONE@}
285         /PRINTBACK=@{ON,OFF@}
286         /RESULTS=@{ON,OFF,TERMINAL,LISTING,BOTH,NONE@}
287
288 (output driver options)
289         /HEADERS=@{NO,YES,BLANK@}
290         /LENGTH=@{NONE,length_in_lines@}
291         /LISTING=@{ON,OFF,filename@}
292         /MORE=@{ON,OFF@}
293         /WIDTH=@{NARROW,WIDTH,n_characters@}
294
295 (logging)
296         /JOURNAL=@{ON,OFF@} [filename]
297
298 (system files)
299         /COMPRESSION=@{ON,OFF@}
300         /SCOMPRESSION=@{ON,OFF@}
301
302 (security)
303         /SAFER=ON
304
305 (obsolete settings accepted for compatibility, but ignored)
306         /BOXSTRING=@{'xxx','xxxxxxxxxxx'@}
307         /CASE=@{UPPER,UPLOW@}
308         /CPI=cpi_value
309         /DISK=@{ON,OFF@}
310         /HIGHRES=@{ON,OFF@}
311         /HISTOGRAM='c'
312         /LOWRES=@{AUTO,ON,OFF@}
313         /LPI=lpi_value
314         /MENUS=@{STANDARD,EXTENDED@}
315         /MXMEMORY=max_memory
316         /SCRIPTTAB='c'
317         /TB1=@{'xxx','xxxxxxxxxxx'@}
318         /TBFONTS='string'
319         /WORKSPACE=workspace_size
320         /XSORT=@{YES,NO@}
321 @end display
322
323 @cmd{SET} allows the user to adjust several parameters relating to
324 PSPP's execution.  Since there are many subcommands to this command, its
325 subcommands will be examined in groups.
326
327 On subcommands that take boolean values, ON and YES are synonym, and
328 as are OFF and NO, when used as subcommand values.
329
330 The data input subcommands affect the way that data is read from data
331 files.  The data input subcommands are
332
333 @table @asis
334 @item BLANKS
335 This is the value assigned to an item data item that is empty or
336 contains only white space.  An argument of SYSMIS or '.' will cause the
337 system-missing value to be assigned to null items.  This is the
338 default.  Any real value may be assigned.
339
340 @item DECIMAL
341 The default DOT setting causes the decimal point character to be
342 @samp{.}.  A setting of COMMA causes the decimal point character to be
343 @samp{,}.
344
345 @item FORMAT
346 Allows the default numeric input/output format to be specified.  The
347 default is F8.2.  @xref{Input/Output Formats}.
348
349 @item EPOCH
350 @anchor{SET EPOCH}
351 Specifies the range of years used when a 2-digit year is read from a
352 data file or used in a date construction expression (@pxref{Date
353 Construction}).  If a 4-digit year is specified, then 2-digit years
354 are interpreted starting from that year, known as the epoch.  If
355 AUTOMATIC (the default) is specified, then the epoch begins 69 years
356 before the current date.
357 @end table
358
359 Program input subcommands affect the way that programs are parsed when
360 they are typed interactively or run from a command file.  They are
361
362 @table @asis
363 @item ENDCMD
364 This is a single character indicating the end of a command.  The default
365 is @samp{.}.  Don't change this.
366
367 @item NULLINE
368 Whether a blank line is interpreted as ending the current command.  The
369 default is ON.
370 @end table
371
372 Interaction subcommands affect the way that PSPP interacts with an
373 online user.  The interaction subcommands are
374
375 @table @asis
376 @item CPROMPT
377 The command continuation prompt.  The default is @samp{    > }.
378
379 @item DPROMPT
380 Prompt used when expecting data input within @cmd{BEGIN DATA} (@pxref{BEGIN
381 DATA}).  The default is @samp{data> }.
382
383 @item ERRORBREAK
384 Whether an error causes PSPP to stop processing the current command
385 file after finishing the current command.  The default is OFF.
386
387 @item MXERRS
388 The maximum number of errors before PSPP halts processing of the current
389 command file.  The default is 50.
390
391 @item MXWARNS
392 The maximum number of warnings + errors before PSPP halts processing the
393 current command file.  The default is 100.
394
395 @item PROMPT
396 The command prompt.  The default is @samp{PSPP> }.
397 @end table
398
399 Program execution subcommands control the way that PSPP commands
400 execute.  The program execution subcommands are
401
402 @table @asis
403 @item MEXPAND
404 @itemx MITERATE
405 @itemx MNEST
406 @itemx MPRINT
407 Currently not used.
408
409 @item MXLOOPS
410 The maximum number of iterations for an uncontrolled loop (@pxref{LOOP}).
411
412 @item SEED
413 The initial pseudo-random number seed.  Set to a real number or to
414 RANDOM, which will obtain an initial seed from the current time of day.
415
416 @item UNDEFINED
417 Currently not used.
418 @end table
419
420 Data output subcommands affect the format of output data.  These
421 subcommands are
422
423 @table @asis
424 @item CCA
425 @itemx CCB
426 @itemx CCC
427 @itemx CCD
428 @itemx CCE
429 Set up custom currency formats.  The argument is a string which must
430 contain exactly three commas or exactly three periods.  If commas, then
431 the grouping character for the currency format is @samp{,}, and the
432 decimal point character is @samp{.}; if periods, then the situation is
433 reversed.  
434
435 The commas or periods divide the string into four fields, which are, in
436 order, the negative prefix, prefix, suffix, and negative suffix.  When a
437 value is formatted using the custom currency format, the prefix precedes
438 the value formatted and the suffix follows it.  In addition, if the
439 value is negative, the negative prefix precedes the prefix and the
440 negative suffix follows the suffix.
441
442 @item DECIMAL
443 The default DOT setting causes the decimal point character to be
444 @samp{.}.  A setting of COMMA causes the decimal point character to be
445 @samp{,}.
446
447 @item FORMAT
448 Allows the default numeric input/output format to be specified.  The
449 default is F8.2.  @xref{Input/Output Formats}.
450 @end table
451
452 Output routing subcommands affect where the output of transformations
453 and procedures is sent.  These subcommands are
454
455 @table @asis
456 @item ECHO
457
458 If turned on, commands are written to the listing file as they are read
459 from command files.  The default is OFF.
460
461 @itemx ERRORS
462 @itemx INCLUDE
463 @itemx MESSAGES
464 @item PRINTBACK
465 @item RESULTS
466 Currently not used.
467 @end table
468
469 Output driver option subcommands affect output drivers' settings.  These
470 subcommands are
471
472 @table @asis
473 @item HEADERS
474 @itemx LENGTH
475 @itemx LISTING
476 @itemx MORE
477 @itemx PAGER 
478 @itemx WIDTH
479 @end table
480
481 @cindex headers
482 @cindex length
483 @cindex listing
484 @cindex more
485 @cindex pager 
486 @cindex width
487
488
489 Logging subcommands affect logging of commands executed to external
490 files.  These subcommands are
491
492 @table @asis
493 @item JOURNAL
494 @item LOG
495 Not currently used.
496 @end table
497
498 System file subcommands affect the default format of system files
499 produced by PSPP.  These subcommands are
500
501 @table @asis
502 @item COMPRESSION
503 Not currently used.
504
505 @item SCOMPRESSION
506 Whether system files created by @cmd{SAVE} or @cmd{XSAVE} are
507 compressed by default.  The default is ON.
508 @end table
509
510 Security subcommands affect the operations that commands are allowed to
511 perform.  The security subcommands are
512
513 @table @asis
514 @item SAFER
515 Setting this option disables the following operations:
516
517 @itemize @bullet
518 @item
519 The ERASE command.
520 @item
521 The HOST command.
522 @item
523 The PERMISSIONS command.
524 @item
525 Pipe filenames (filenames beginning or ending with @samp{|}).
526 @end itemize
527
528 Be aware that this setting does not guarantee safety (commands can still
529 overwrite files, for instance) but it is an improvement.
530 When set, this setting cannot be reset during the same session, for
531 obvious security reasons.
532 @end table
533
534 @node SHOW, SUBTITLE, SET, Utilities
535 @comment  node-name,  next,  previous,  up
536 @section SHOW
537 @vindex SHOW
538
539 @display
540 SHOW
541         [ALL]
542         [BLANKS]
543         [CC]
544         [CCA]
545         [CCB]
546         [CCC]
547         [CCD]
548         [CCE]
549         [COPYING]
550         [DECIMALS]
551         [ENDCMD]
552         [FORMAT]
553         [LENGTH]
554         [MXERRS]
555         [MXLOOPS]
556         [MXWARNS]
557         [SCOMPRESSION]
558         [UNDEFINED]
559         [WARRANTY]
560         [WEIGHT]
561         [WIDTH]
562 @end display
563
564 @cmd{SHOW} can be used to display the current state of PSPP's execution
565 parameters.  Parameters that can be changed using @cmd{SET}
566 (@pxref{SET}), can be examined using @cmd{SHOW} using the subcommand
567 with the same name.  @code{SHOW} supports the following additional
568 subcommands:
569
570 @table @code
571 @item ALL
572 Show all settings.
573 @item CC
574 Show all custom currency settings (CCA through CCE).
575 @item WARRANTY
576 Show details of the lack of warranty for PSPP.
577 @item COPYING
578 Display the terms of PSPP's copyright licence (@pxref{License}).
579 @end table
580
581 Specifying @cmd{SHOW} without any subcommands is equivalent to SHOW ALL.
582
583 @node SUBTITLE, TITLE, SHOW, Utilities
584 @section SUBTITLE
585 @vindex SUBTITLE
586
587 @display
588 SUBTITLE 'subtitle_string'.
589   or
590 SUBTITLE subtitle_string.
591 @end display
592
593 @cmd{SUBTITLE} provides a subtitle to a particular PSPP
594 run.  This subtitle appears at the top of each output page below the
595 title, if headers are enabled on the output device.
596
597 Specify a subtitle as a string in quotes.  The alternate syntax that did
598 not require quotes is now obsolete.  If it is used then the subtitle is
599 converted to all uppercase.
600
601 @node TITLE,  , SUBTITLE, Utilities
602 @section TITLE
603 @vindex TITLE
604
605 @display
606 TITLE 'title_string'.
607   or
608 TITLE title_string.
609 @end display
610
611 @cmd{TITLE} provides a title to a particular PSPP run.
612 This title appears at the top of each output page, if headers are enabled
613 on the output device.
614
615 Specify a title as a string in quotes.  The alternate syntax that did
616 not require quotes is now obsolete.  If it is used then the title is
617 converted to all uppercase.
618 @setfilename ignored