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