[Top] [Contents] [Index] [ ? ]

PSPP

This file documents the PSPP package for statistical analysis of sampled data. This is edition 0.2, for PSPP version 0.2, last modified at Time-stamp: <2000-01-02 22:32:14 blp>.

1. Introduction  Description of the package.
2. Your rights and obligations  
3. Credits  Acknowledgement of authors.

4. Installing PSPP  How to compile and install PSPP.
5. Configuring PSPP  
6. Invoking PSPP  Starting and running PSPP.

7. The PSPP language  Basics of the PSPP command language.
8. Mathematical Expressions  Numeric and string expression syntax.

9. Data Input and Output  Reading data from user files.
10. System Files and Portable Files  Dealing with system & portable files.
11. Manipulating variables  Adjusting and examining variables.
12. Data transformations  Simple operations on data.
13. Selecting data for analysis  Select certain cases for analysis.
14. Conditional and Looping Constructs  Doing things many times or not at all.
15. Statistics  Basic statistical procedures.
16. Utilities  Other commands.
17. Not Implemented  What's not here yet

18. Data File Format  Format of PSPP system files.
19. Portable File Format  Format of PSPP portable files.
20. q2c Input Format  Format of syntax accepted by q2c.

21. Bugs  Known problems; submitting bug reports.

22. Function Index  Index of PSPP functions for expressions.
23. Concept Index  Index of concepts.
24. Command Index  Index of PSPP procedures.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. Introduction

PSPP is a tool for statistical analysis of sampled data. It reads a syntax file and a data file, analyzes the data, and writes the results to a listing file or to standard output.

The language accepted by PSPP is similar to those accepted by SPSS statistical products. The details of PSPP's language are given later in this manual.

PSPP produces output in two forms: tables and charts. Both of these can be written in several formats; currently, ASCII, PostScript, and HTML are supported. In the future, more drivers, such as PCL and X Window System drivers, may be developed. For now, Ghostscript, available from the Free Software Foundation, may be used to convert PostScript chart output to other formats.

The current version of PSPP, 0.2, is woefully incomplete in terms of its statistical procedure support. PSPP is a work in progress. The author hopes to support fully support all features in the products that PSPP replaces, eventually. The author welcomes questions, comments, donations, and code submissions. See section Submitting Bug Reports, for instructions on contacting the author.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Your rights and obligations

Most of PSPP is distributed under the GNU General Public License. The General Public License says, in effect, that you may modify and distribute PSPP as you like, as long as you grant the same rights to others. It also states that you must provide source code when you distribute PSPP, or, if you obtained PSPP source code from an anonymous ftp site, give out the name of that site.

The General Public License is given in full in the source distribution as file `COPYING'. In Debian GNU/Linux, this file is also available as file `/usr/doc/copyright/GPL'.

To quote the GPL itself:

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Credits

I'm always embarrassed when I see an index an author has made of his own work. It's a shameless exhibition--to the trained eye. Never index your own book.

---Claire Minton, Cat's Cradle, Kurt Vonnegut, Jr.

Most of PSPP, as well as this manual (including the indices), was written by Ben Pfaff. See section 21.2 Contacting the Author, for instructions on contacting the author.

The PSPP source code incorporates julcal10 originally written by Michael A. Covington and translated into C by Jim Van Zandt. The original package can be found in directory `ftp://ftp.cdrom.com/pub/algorithms/c/julcal10'. The entire contents of that directory constitute the package. The files actually used in PSPP are julcal.c and julcal.h.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4. Installing PSPP

PSPP conforms to the GNU Coding Standards. PSPP is written in, and requires for proper operation, ANSI/ISO C. You might want to additionally note the following points:

Many UNIX variants should work out-of-the-box, as PSPP uses GNU autoconf to detect differences between environments. Please report any problems with compilation of PSPP under UNIX and UNIX-like operating systems--portability is a major concern of the author.

The pages below give specific instructions for installing PSPP on each type of system mentioned above.

4.1 UNIX installation  Installing on UNIX-like environments.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 UNIX installation

To install PSPP under a UNIX-like operating system, follow the steps below in order. Some of the text below was taken directly from various Free Software Foundation sources.

  1. cd to the directory containing the PSPP source.

  2. Type `./configure' to configure for your particular operating system and compiler. Running configure takes a while. While running, it displays some messages telling which features it is checking for.

    You can optionally supply some options to configure in order to give it hints about how to do its job. Type ./configure --help to see a list of options. One of the most useful options is `--with-checker', which enables the use of the Checker memory debugger under supported operating systems. Checker must already be installed to use this option. Do not use `--with-checker' if you are not debugging PSPP itself.

  3. (optional) Edit `Makefile', `config.h', and `pref.h'. These files are produced by configure. Note that most PSPP settings can be changed at runtime.

    `pref.h' is only generated by configure if it does not already exist. (It's copied from `prefh.orig'.)

  4. Type `make' to compile the package. If there are any errors during compilation, try to fix them. If modifications are necessary to compile correctly under your configuration, contact the author. See section Submitting Bug Reports, for details.

  5. Type `make check' to run self-tests on the compiled PSPP package.

  6. Become the superuser and type `make install' to install the PSPP binaries, by default in `/usr/local/bin/'. The directory `/usr/local/share/pspp/' is created and populated with files needed by PSPP at runtime. This step will also cause the PSPP documentation to be installed in `/usr/local/info/', but only if that directory already exists.

  7. (optional) Type `make clean' to delete the PSPP binaries from the source tree.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5. Configuring PSPP

PSPP has dozens of configuration possibilities and hundreds of settings. This is both a bane and a blessing. On one hand, it's possible to easily accommodate diverse ranges of setups. But, on the other, the multitude of possibilities can overwhelm the casual user. Fortunately, the configuration mechanisms are profusely described in the sections below....

5.1 Locating configuration files  How PSPP finds config files.
5.2 Configuration techniques  Many different methods of configuration....
5.3 Configuration files  How configuration files are read.
5.4 Environment variables  All about environment variables.
5.5 Output devices  Describing your terminal(s) and printer(s).
5.6 The PostScript driver class  Configuration of PostScript devices.
5.7 The ASCII driver class  Configuration of character-code devices.
5.8 The HTML driver class  Configuration for HTML output.
5.9 Miscellaneous configuration  Even more configuration variables.
5.10 Improving output quality  Hints for producing ever-more-lovely output.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1 Locating configuration files

PSPP uses the same method to find most of its configuration files:

  1. The base name of the file being sought is determined.

  2. The path to search is determined.

  3. Each directory in the search path, from left to right, is searched for a file with the name of the base name. The first occurrence is read as the configuration file.

The first two steps are elaborated below for the sake of our pedantic friends.

  1. A base name is a file name lacking an absolute directory reference. Some examples of base names are: `ps-encodings', `devices', `devps/DESC' (under UNIX), `devps\DESC' (under M$ environments).

    Determining the base name is a two-step process:

    1. If the appropriate environment variable is defined, the value of that variable is used (see section 5.4 Environment variables). For instance, when searching for the output driver initialization file, the variable examined is STAT_OUTPUT_INIT_FILE.

    2. Otherwise, the compiled-in default is used. For example, when searching for the output driver initialization file, the default base name is `devices'.

    Please note: If a user-specified base name does contain an absolute directory reference, as in a file name like `/home/pfaff/fonts/TR', no path is searched--the file name is used exactly as given--and the algorithm terminates.

  2. The path is the first of the following that is defined:

As a final note: Under DOS, directories given in paths are delimited by semicolons (`;'); under UNIX, directories are delimited by colons (`:'). This corresponds with the standard path delimiter under these OSes.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.2 Configuration techniques

There are many ways that PSPP can be configured. These are described in the list below. Values given by earlier items take precedence over those given by later items.

  1. Syntax commands that modify settings, such as SET.

  2. Command-line options. See section 6. Invoking PSPP.

  3. PSPP-specific environment variable contents. See section 5.4 Environment variables.

  4. General environment variable contents. See section 5.4 Environment variables.

  5. Configuration file contents. See section 5.3 Configuration files.

  6. Fallback defaults.

Some of the above may not apply to a particular setting. For instance, the current pager (such as `more', `most', or `less') cannot be determined by configuration file contents because there is no appropriate configuration file.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.3 Configuration files

Most configuration files have a common form:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4 Environment variables

You may think the concept of environment variables is a fairly simple one. However, the author of PSPP has found a way to complicate even something so simple. Environment variables are further described in the sections below:

5.4.1 Values of environment variables  Values of variables are determined this way.
5.4.2 Environment substitutions  How environment substitutions are made.
5.4.3 Predefined environment variables  A few variables are automatically defined.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4.1 Values of environment variables

Values for environment variables are obtained by the following means, which are arranged in order of decreasing precedence:

  1. Command-line options. See section 6. Invoking PSPP.

  2. The `environment' configuration file--more on this below.

  3. Actual environment variables (defined in the shell or other parent process).

The `environment' configuration file is located through application of the usual algorithm for configuration files (see section 5.1 Locating configuration files), except that its contents do not affect the search path used to find `environment' itself. Use of `environment' is discouraged on systems that allow an arbitrarily large environment; it is supported for use on systems like MS-DOS that limit environment size.

`environment' is composed of lines having the form `key=value', where key and the equals sign (`=') are required, and value is optional. If value is given, variable key is given that value; if value is absent, variable key is undefined (deleted). Variables may not be defined with a null value.

Environment substitutions are performed on each line in the file (see section 5.4.2 Environment substitutions).

See 5.3 Configuration files, for more details on formatting of the environment configuration file.

Please note: Support for `environment' is not yet implemented.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4.2 Environment substitutions

Much of the power of environment variables lies in the way that they may be substituted into configuration files. Variable substitutions are described below.

The line is scanned from left to right. In this scan, all characters other than dollar signs (`$') are retained unmolested. Dollar signs, however, introduce an environment variable reference. References take three forms:

$var
Replaced by the value of environment variable var, determined as specified in 5.4.1 Values of environment variables. var must be one of the following:

${var}
Same as above, but var may contain any character (except `}').

$$
Replaced by a single dollar sign.

Undefined variables expand to a empty value.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4.3 Predefined environment variables

There are two environment variables predefined for use in environment substitutions:

`VER'
Defined as the version number of PSPP, as a string, in a format something like `0.9.4'.

`ARCH'
Defined as the host architecture of PSPP, as a string, in standard cpu-manufacturer-OS format. For instance, Debian GNU/Linux 1.1 on an Intel machine defines this as `i586-unknown-linux'. This is somewhat dependent on the system used to compile PSPP.

Nothing prevents these values from being overridden, although it's a good idea not to do so.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5 Output devices

Configuring output devices is the most complicated aspect of configuring PSPP. The output device configuration file is named `devices'. It is searched for using the usual algorithm for finding configuration files (see section 5.1 Locating configuration files). Each line in the file is read in the usual manner for configuration files (see section 5.3 Configuration files).

Lines in `devices' are divided into three categories, described briefly in the table below:

driver category definitions
Define a driver in terms of other drivers.

macro definitions
Define environment variables local to the the output driver configuration file.

device definitions
Describe the configuration of an output device.

The following sections further elaborate the contents of the `devices' file.

5.5.1 Driver categories  How to organize the driver namespace.
5.5.2 Macro definitions  Environment variables local to `devices'.
5.5.3 Driver definitions  Output device descriptions.
5.5.4 Dimensions  Lengths, widths, sizes, ....
5.5.5 Paper sizes  Letter, legal, A4, envelope, ....
5.5.6 How lines are divided into types  Details on `devices' parsing.
5.5.7 How lines are divided into tokens  Dividing `devices' lines into tokens.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.1 Driver categories

Drivers can be divided into categories. Drivers are specified by their names, or by the names of the categories that they are contained in. Only certain drivers are enabled each time PSPP is run; by default, these are the drivers in the category `default'. To enable a different set of drivers, use the `-o device' command-line option (see section 6. Invoking PSPP).

Categories are specified with a line of the form `category=driver1 driver2 driver3 ... drivern'. This line specifies that the category category is composed of drivers named driver1, driver2, and so on. There may be any number of drivers in the category, from zero on up.

Categories may also be specified on the command line (see section 6. Invoking PSPP).

This is all you need to know about categories. If you're still curious, read on.

First of all, the term `categories' is a bit of a misnomer. In fact, the internal representation is nothing like the hierarchy that the term seems to imply: a linear list is used to keep track of the enabled drivers.

When PSPP first begins reading `devices', this list contains the name of any drivers or categories specified on the command line, or the single item `default' if none were specified.

Each time a category definition is specified, the list is searched for an item with the value of category. If a matching item is found, it is deleted. If there was a match, the list of drivers (driver1 through drivern) is then appended to the list.

Each time a driver definition line is encountered, the list is searched. If the list contains an item with that driver's name, the driver is enabled and the item is deleted from the list. Otherwise, the driver is not enabled.

It is an error if the list is not empty when the end of `devices' is reached.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.2 Macro definitions

Macro definitions take the form `define macroname definition'. In such a macro definition, the environment variable macroname is defined to expand to the value definition. Before the definition is made, however, any macros used in definition are expanded.

Please note the following nuances of macro usage:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.3 Driver definitions

Driver definitions are the ultimate purpose of the `devices' configuration file. These are where the real action is. Driver definitions tell PSPP where it should send its output.

Each driver definition line is divided into four fields. These fields are delimited by colons (`:'). Each line is subjected to environment variable interpolation before it is processed further (see section 5.4.2 Environment substitutions). From left to right, the four fields are, in brief:

driver name
A unique identifier, used to determine whether to enable the driver.

class name
One of the predefined driver classes supported by PSPP. The currently supported driver classes include `postscript' and `ascii'.

device type(s)
Zero or more of the following keywords, delimited by spaces:

screen

Indicates that the device is a screen display. This may reduce the amount of buffering done by the driver, to make interactive use more convenient.

printer

Indicates that the device is a printer.

listing

Indicates that the device is a listing file.

These options are just hints to PSPP and do not cause the output to be directed to the screen, or to the printer, or to a listing file--those must be set elsewhere in the options. They are used primarily to decide which devices should be enabled at any given time. See section 16.10 SET, for more information.

options
An optional set of options to pass to the driver itself. The exact format for the options varies among drivers.

The driver is enabled if:

  1. Its driver name is specified on the command line, or

  2. It's in a category specified on the command line, or

  3. If no categories or driver names are specified on the command line, it is in category default.

For more information on driver names, see 5.5.1 Driver categories.

The class name must be one of those supported by PSPP. The classes supported depend on the options with which PSPP was compiled. See later sections in this chapter for descriptions of the available driver classes.

Options are dependent on the driver. See the driver descriptions for details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.4 Dimensions

Quite often in configuration it is necessary to specify a length or a size. PSPP uses a common syntax for all such, calling them collectively by the name dimensions.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.5 Paper sizes

Output drivers usually deal with some sort of hardcopy media. This media is called paper by the drivers, though in reality it could be a transparency or film or thinly veiled sarcasm. To make it easier for you to deal with paper, PSPP allows you to have (of course!) a configuration file that gives symbolic names, like "letter" or "legal" or "a4", to paper sizes, rather than forcing you to use cryptic numbers like "8-1/2 x 11" or "210 by 297". Surprisingly enough, this configuration file is named `papersize'. See section 5.3 Configuration files.

When PSPP tries to connect a symbolic paper name to a paper size, it reads and parses each non-comment line in the file, in order. The first field on each line must be a symbolic paper name in double quotes. Paper names may not contain double quotes. Paper names are not case-sensitive: `legal' and `Legal' are equivalent.

If a match is found for the paper name, the rest of the line is parsed. If it is found to be a pair of dimensions (see section 5.5.4 Dimensions) separated by either `x' or `by', then those are taken to be the paper size, in order of width followed by length. There must be at least one space on each side of `x' or `by'.

Otherwise the line must be of the form `"paper-1"="paper-2"'. In this case the target of the search becomes paper name paper-2 and the search through the file continues.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.6 How lines are divided into types

The lines in `devices' are distinguished in the following manner:

  1. Leading whitespace is removed.

  2. If the resulting line begins with the exact string define, followed by one or more whitespace characters, the line is processed as a macro definition.

  3. Otherwise, the line is scanned for the first instance of a colon (`:') or an equals sign (`=').

  4. If a colon is encountered first, the line is processed as a driver definition.

  5. Otherwise, if an equals sign is encountered, the line is processed as a macro definition.

  6. Otherwise, the line is ill-formed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.7 How lines are divided into tokens

Each driver definition line is run through a simple tokenizer. This tokenizer recognizes two basic types of tokens.

The first type is an equals sign (`='). Equals signs are both delimiters between tokens and tokens in themselves.

The second type is an identifier or string token. Identifiers and strings are equivalent after tokenization, though they are written differently. An identifier is any string of characters other than whitespace or equals sign.

A string is introduced by a single- or double-quote character (`'' or `"') and, in general, continues until the next occurrence of that same character. The following standard C escapes can also be embedded within strings:

\'
A single-quote (`'').

\"
A double-quote (`"').

\?
A question mark (`?'). Included for hysterical raisins.

\\
A backslash (`\').

\a
Audio bell (ASCII 7).

\b
Backspace (ASCII 8).

\f
Formfeed (ASCII 12).

\n
Newline (ASCII 10)

\r
Carriage return (ASCII 13).

\t
Tab (ASCII 9).

\v
Vertical tab (ASCII 11).

\ooo
Each `o' must be an octal digit. The character is the one having the octal value specified. Any number of octal digits is read and interpreted; only the lower 8 bits are used.

\xhh
Each `h' must be a hex digit. The character is the one having the hexadecimal value specified. Any number of hex digits is read and interpreted; only the lower 8 bits are used.

Tokens, outside of quoted strings, are delimited by whitespace or equals signs.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6 The PostScript driver class

The postscript driver class is used to produce output that is acceptable to PostScript printers and to PC-based PostScript interpreters such as Ghostscript. Continuing a long tradition, PSPP's PostScript driver is configurable to the point of absurdity.

There are actually two PostScript drivers. The first one, `postscript', produces ordinary DSC-compliant PostScript output. The second one `epsf', produces an Encapsulated PostScript file. The two drivers are otherwise identical in configuration and in operation.

The PostScript driver is described in further detail below.

5.6.1 PostScript output options  Output file options.
5.6.2 PostScript page options  Paper, margins, scaling & rotation, more!
5.6.3 PostScript file options  Configuration files.
5.6.4 PostScript font options  Default fonts, font options.
5.6.5 PostScript line options  Line widths, options.
5.6.6 The PostScript prologue  Details on the PostScript prologue.
5.6.7 PostScript encodings  Details on PostScript font encodings.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6.1 PostScript output options

These options deal with the form of the output and the output file itself:

output-file=filename

File to which output should be sent. This can be an ordinary filename (i.e., "pspp.ps"), a pipe filename (i.e., "|lpr"), or stdout ("-"). Default: "pspp.ps".

color=boolean

Most of the time black-and-white PostScript devices are smart enough to map colors to shades themselves. However, you can cause the PSPP output driver to do an ugly simulation of this in its own driver by turning color off. Default: on.

This is a boolean setting, as are many settings in the PostScript driver. Valid positive boolean values are `on', `true', `yes', and nonzero integers. Negative boolean values are `off', `false', `no', and zero.

data=data-type

One of clean7bit, clean8bit, or binary. This controls what characters will be written to the output file. PostScript produced with clean7bit can be transmitted over 7-bit transmission channels that use ASCII control characters for line control. clean8bit is similar but allows characters above 127 to be written to the output file. binary allows any character in the output file. Default: clean7bit.

line-ends=line-end-type

One of cr, lf, or crlf. This controls what is used for newline in the output file. Default: cr.

optimize-line-size=level

Either 0 or 1. If level is 1, then short line segments will be collected and merged into longer ones. This reduces output file size but requires more time and memory. A level of 0 has the advantage of being better for interactive environments. 1 is the default unless the screen flag is set; in that case, the default is 0.

optimize-text-size=level

One of 0, 1, or 2, each higher level representing correspondingly more aggressive space savings for text in the output file and requiring correspondingly more time and memory. Unfortunately the levels presently are all the same. 1 is the default unless the screen flag is set; in that case, the default is 0.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6.2 PostScript page options

These options affect page setup:

headers=boolean

Controls whether the standard headers showing the time and date and title and subtitle are printed at the top of each page. Default: on.

paper-size=paper-size

Paper size, either as a symbolic name (i.e., letter or a4) or specific measurements (i.e., 8-1/2x11 or "210 x 297". See section Paper sizes. Default: letter.

orientation=orientation

Either portrait or landscape. Default: portrait.

left-margin=dimension
right-margin=dimension
top-margin=dimension
bottom-margin=dimension

Sets the margins around the page. The headers, if enabled, are not included in the margins; they are in addition to the margins. For a description of dimensions, see 5.5.4 Dimensions. Default: 0.5in.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6.3 PostScript file options

Oh, my. You don't really want to know about the way that the PostScript driver deals with files, do you? Well I suppose you're entitled, but I warn you right now: it's not pretty. Here goes....

First let's look at the options that are available:

font-dir=font-directory

Sets the font directory. Default: devps.

prologue-file=prologue-file-name

Sets the name of the PostScript prologue file. You can write your own prologue, though I have no idea why you'd want to: see 5.6.6 The PostScript prologue. Default: ps-prologue.

device-file=device-file-name

Sets the name of the Groff-format device description file. The PostScript driver reads this in order to know about the scaling of fonts and so on. The format of such files is described in groff_font(5), included with Groff. Default: DESC.

encoding-file=encoding-file-name

Sets the name of the encoding file. This file contains a list of all font encodings that will be needed so that the driver can put all of them at the top of the prologue. See section 5.6.7 PostScript encodings. Default: ps-encodings.

If the specified encoding file cannot be found, this error will be silently ignored, since most people do not need any encodings besides the ones that can be found using auto-encodings, described below.

auto-encode=boolean

When enabled, the font encodings needed by the default proportional- and fixed-pitch fonts will automatically be dumped to the PostScript output. Otherwise, it is assumed that the user has an encoding file and knows how to use it (see section 5.6.7 PostScript encodings). There is probably no good reason to turn off this convenient feature. Default: on.

Next I suppose it's time to describe the search algorithm. When the PostScript driver needs a file, whether that file be a font, a PostScript prologue, or what you will, it searches in this manner:

  1. Constructs a path by taking the first of the following that is defined:

    1. Environment variable STAT_GROFF_FONT_PATH. See section 5.4 Environment variables.

    2. Environment variable GROFF_FONT_PATH.

    3. The compiled-in fallback default.

  2. Constructs a base name from concatenating, in order, the font directory, a path separator (`/' or `\'), and the file to be found. A typical base name would be something like devps/ps-encodings.

  3. Searches for the base name in the path constructed above. If the file is found, the algorithm terminates.

  4. Searches for the base name in the standard configuration path. See 5.1 Locating configuration files, for more details. If the file is found, the algorithm terminates.

  5. At this point we remove the font directory and path separator from the base name. Now the base name is simply the file to be found, i.e., ps-encodings.

  6. Searches for the base name in the path constructed in the first step. If the file is found, the algorithm terminates.

  7. Searches for the base name in the standard configuration path. If the file is found, the algorithm terminates.

  8. The algorithm terminates unsuccessfully.

So, as you see, there are several ways to configure the PostScript drivers. Careful selection of techniques can make the configuration very flexible indeed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6.4 PostScript font options

The list of available font options is short and sweet:

prop-font=font-name

Sets the default proportional font. The name should be that of a PostScript font. Default: "Helvetica".

fixed-font=font-name

Sets the default fixed-pitch font. The name should be that of a PostScript font. Default: "Courier".

font-size=font-size

Sets the size of the default fonts, in thousandths of a point. Default: 10000.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6.5 PostScript line options

Most tables contain lines, or rules, between cells. Some features of the way that lines are drawn in PostScript tables are user-definable:

line-style=style

Sets the style used for lines used to divide tables into sections. style must be either thick, in which case thick lines are used, or double, in which case double lines are used. Default: thick.

line-gutter=dimension

Sets the line gutter, which is the amount of whitespace on either side of lines that border text or graphics objects. See section 5.5.4 Dimensions. Default: 0.5pt.

line-spacing=dimension

Sets the line spacing, which is the amount of whitespace that separates lines that are side by side, as in a double line. Default: 0.5pt.

line-width=dimension

Sets the width of a typical line used in tables. Default: 0.5pt.

line-width-thick=dimension

Sets the width of a thick line used in tables. Not used if line-style is set to thick. Default: 1.5pt.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6.6 The PostScript prologue

Most PostScript files that are generated mechanically by programs consist of two parts: a prologue and a body. The prologue is generally a collection of boilerplate. Only the body differs greatly between two outputs from the same program. This is also the strategy used in the PSPP PostScript driver. In general, the prologue supplied with PSPP will be more than sufficient. In this case, you will not need to read the rest of this section. However, hackers might want to know more. Read on, if you fall into this category.

The prologue is dumped into the output stream essentially unmodified. However, two actions are performed on its lines. First, certain lines may be omitted as specified in the prologue file itself. Second, variables are substituted.

The following lines are omitted:

  1. All lines that contain three bangs in a row (!!!).

  2. Lines that contain !eps, if the PostScript driver is producing ordinary PostScript output. Otherwise an EPS file is being produced, and the line is included in the output, although everything following !eps is deleted.

  3. Lines that contain !ps, if the PostScript driver is producing EPS output. Otherwise, ordinary PostScript is being produced, and the line is included in the output, although everything following !ps is deleted.

The following are the variables that are substituted. Only the variables listed are substituted; environment variables are not. See section 5.4.2 Environment substitutions.

bounding-box

The page bounding box, in points, as four space-separated numbers. For U.S. letter size paper, this is `0 0 612 792'.

creator

PSPP version as a string: `GNU PSPP 0.1b', for example.

date

Date the file was created. Example: `Tue May 21 13:46:22 1991'.

data

Value of the data PostScript driver option, as one of the strings `Clean7Bit', `Clean8Bit', or `Binary'.

orientation

Page orientation, as one of the strings Portrait or Landscape.

user

Under multiuser OSes, the user's login name, taken either from the environment variable LOGNAME or, if that fails, the result of the C library function getlogin(). Defaults to `nobody'.

host

System hostname as reported by gethostname(). Defaults to `nowhere'.

prop-font

Name of the default proportional font, prefixed by the word `font' and a space. Example: `font Times-Roman'.

fixed-font

Name of the default fixed-pitch font, prefixed by the word `font' and a space.

scale-factor

The page scaling factor as a floating-point number. Example: 1.0. Note that this is also passed as an argument to the BP macro.

paper-length
paper-width

The paper length and paper width, respectively, in thousandths of a point. Note that these are also passed as arguments to the BP macro.

left-margin
top-margin

The left margin and top margin, respectively, in thousandths of a point. Note that these are also passed as arguments to the BP macro.

title

Document title as a string. This is not the title specified in the PSPP syntax file. A typical title is the word `PSPP' followed by the syntax file name in parentheses. Example: `PSPP (<stdin>)'.

source-file

PSPP syntax file name. Example: `mary96/first.stat'.

Any other questions about the PostScript prologue can best be answered by examining the default prologue or the PSPP source.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6.7 PostScript encodings

PostScript fonts often contain many more than 256 characters, in order to accommodate foreign language characters and special symbols. PostScript uses encodings to map these onto single-byte symbol sets. Each font can have many different encodings applied to it.

PSPP's PostScript driver needs to know which encoding to apply to each font. It can determine this from the information encapsulated in the Groff font description that it reads. However, there is an additional problem--for efficiency, the PostScript driver needs to have a complete list of all encodings that will be used in the entire session when it opens the output file. For this reason, it can't use the information built into the fonts because it doesn't know which fonts will be used.

As a stopgap solution, there are two mechanisms for specifying which encodings will be used. The first mechanism is automatic and it is the only one that most PSPP users will ever need. The second mechanism is manual, but it is more flexible. Either mechanism or both may be used at one time.

The first mechanism is activated by the `auto-encode' driver option (see section 5.6.3 PostScript file options). When enabled, `auto-encode' causes the PostScript driver to include the encodings used by the default proportional and fixed-pitch fonts (see section 5.6.4 PostScript font options). Many PSPP output files will only need these encodings.

The second mechanism is the file specified by the `encoding-file' option (see section 5.6.3 PostScript file options). If it exists, this file must consist of lines in PSPP configuration-file format (see section 5.3 Configuration files). Each line that is not a comment should name a PostScript encoding to include in the output.

It is not an error if an encoding is included more than once, by either mechanism. It will appear only once in the output. It is also not an error if an encoding is included in the output but never used. It is an error if an encoding is used but not included by one of these mechanisms. In this case, the built-in PostScript encoding `ISOLatin1Encoding' is substituted.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.7 The ASCII driver class

The ASCII driver class produces output that can be displayed on a terminal or output to printers. All of its options are highly configurable. The ASCII driver has class name `ascii'.

The ASCII driver is described in further detail below.

5.7.1 ASCII output options  Output file options.
5.7.2 ASCII page options  Page size, margins, more.
5.7.3 ASCII font options  Box character, bold & italics.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.7.1 ASCII output options

output-file=filename

File to which output should be sent. This can be an ordinary filename (i.e., "pspp.ps"), a pipe filename (i.e., "|lpr"), or stdout ("-"). Default: "pspp.list".

char-set=char-set-type

One of `ascii' or `latin1'. This has no effect on output at the present time. Default: ascii.

form-feed-string=form-feed-value

The string written to the output to cause a formfeed. See also paginate, described below, for a related setting. Default: "\f".

newline-string=newline-value

The string written to the output to cause a newline (carriage return plus linefeed). The default, which can be specified explicitly with newline-string=default, is to use the system-dependent newline sequence by opening the output file in text mode. This is usually the right choice.

However, newline-string can be set to any string. When this is done, the output file is opened in binary mode.

paginate=boolean

If set, a formfeed (as set in form-feed-string, described above) will be written to the device after every page. Default: on.

tab-width=tab-width-value

The distance between tab stops for this device. If set to 0, tabs will not be used in the output. Default: 8.

init=initialization-string.

String written to the device before anything else, at the beginning of the output. Default: "" (the empty string).

done=finalization-string.

String written to the device after everything else, at the end of the output. Default: "" (the empty string).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.7.2 ASCII page options

These options affect page setup:

headers=boolean

If enabled, two lines of header information giving title and subtitle, page number, date and time, and PSPP version are printed at the top of every page. These two lines are in addition to any top margin requested. Default: on.

length=line-count

Physical length of a page, in lines. Headers and margins are subtracted from this value. Default: 66.

width=character-count

Physical width of a page, in characters. Margins are subtracted from this value. Default: 130.

lpi=lines-per-inch

Number of lines per vertical inch. Not currently used. Default: 6.

cpi=characters-per-inch

Number of characters per horizontal inch. Not currently used. Default: 10.

left-margin=left-margin-width

Width of the left margin, in characters. PSPP subtracts this value from the page width. Default: 0.

right-margin=right-margin-width

Width of the right margin, in characters. PSPP subtracts this value from the page width. Default: 0.

top-margin=top-margin-lines

Length of the top margin, in lines. PSPP subtracts this value from the page length. Default: 2.

bottom-margin=bottom-margin-lines

Length of the bottom margin, in lines. PSPP subtracts this value from the page length. Default: 2.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.7.3 ASCII font options

These are the ASCII font options:

box[line-type]=box-chars

The characters used for lines in tables produced by the ASCII driver can be changed using this option. line-type is used to indicate which type of line to change; box-chars is the character or string of characters to use for this type of line.

line-type must be a 4-digit number in base 4. The digits are in the order `right', `bottom', `left', `top'. The four possibilities for each digit are:

0
No line.

1
Single line.

2
Double line.

3
Special device-defined line, if one is available; otherwise, a double line.

Examples:

box[0101]="|"

Sets `|' as the character to use for a single-width line with bottom and top components.

box[2222]="#"

Sets `#' as the character to use for the intersection of four double-width lines, one each from the top, bottom, left and right.

box[1100]="\xda"

Sets `"\xda"', which under MS-DOG is a box character suitable for the top-left corner of a box, as the character for the intersection of two single-width lines, one each from the right and bottom.

Defaults:

italic-on=italic-on-string

Character sequence written to turn on italics or underline printing. If this is set to overstrike, then the driver will simulate underlining by overstriking with underscore characters (`_') in the manner described by overstrike-style and carriage-return-style. Default: overstrike.

italic-off=italic-off-string

Character sequence to turn off italics or underline printing. Default: "" (the empty string).

bold-on=bold-on-string

Character sequence written to turn on bold or emphasized printing. If set to overstrike, then the driver will simulated bold printing by overstriking characters in the manner described by overstrike-style and carriage-return-style. Default: overstrike.

bold-off=bold-off-string

Character sequence to turn off bold or emphasized printing. Default: "" (the empty string).

bold-italic-on=bold-italic-on-string

Character sequence written to turn on bold-italic printing. If set to overstrike, then the driver will simulate bold-italics by overstriking twice, once with the character, a second time with an underscore (`_') character, in the manner described by overstrike-style and carriage-return-style. Default: overstrike.

bold-italic-off=bold-italic-off-string

Character sequence to turn off bold-italic printing. Default: "" (the empty string).

overstrike-style=overstrike-option

Either single or line:

single is recommended for use with ttys and programs that understand overstriking in text files, such as the pager less. single will also work with printer devices but results in rapid back-and-forth motions of the printhead that can cause the printer to physically overheat!

line is recommended for use with printer devices. Most programs that understand overstriking in text files will not properly deal with line mode.

Default: single.

carriage-return-style=carriage-return-type

Either bs or cr. This option applies only when one or more of the font commands is set to overstrike and, at the same time, overstrike-style is set to line.

Although cr is preferred as being more compact, bs is more general since some devices do not interpret carriage returns in the desired manner. Default: bs.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.8 The HTML driver class

The html driver class is used to produce output for viewing in tables-capable web browsers such as Emacs' w3-mode. Its configuration is very simple. Currently, the output has a very plain format. In the future, further work may be done on improving the output appearance.

There are few options for use with the html driver class:

output-file=filename

File to which output should be sent. This can be an ordinary filename (i.e., "pspp.ps"), a pipe filename (i.e., "|lpr"), or stdout ("-"). Default: "pspp.html".

prologue-file=prologue-file-name

Sets the name of the PostScript prologue file. You can write your own prologue if you want to customize colors or other settings: see 5.8.1 The HTML prologue. Default: html-prologue.

5.8.1 The HTML prologue  Format of the HTML prologue file.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.8.1 The HTML prologue

HTML files that are generated by PSPP consist of two parts: a prologue and a body. The prologue is a collection of boilerplate. Only the body differs greatly between two outputs. You can tune the colors and other attributes of the output by editing the prologue. The prologue is dumped into the output stream essentially unmodified. However, two actions are performed on its lines. First, certain lines may be omitted as specified in the prologue file itself. Second, variables are substituted.

The following lines are omitted:

  1. All lines that contain three bangs in a row (!!!).

  2. Lines that contain !title, if no title is set for the output. If a title is set, then the characters !title are removed before the line is output.

  3. Lines that contain !subtitle, if no subtitle is set for the output. If a subtitle is set, then the characters !subtitle are removed before the line is output.

The following are the variables that are substituted. Only the variables listed are substituted; environment variables are not. See section 5.4.2 Environment substitutions.

generator

PSPP version as a string: `GNU PSPP 0.1b', for example.

date

Date the file was created. Example: `Tue May 21 13:46:22 1991'.

user

Under multiuser OSes, the user's login name, taken either from the environment variable LOGNAME or, if that fails, the result of the C library function getlogin(). Defaults to `nobody'.

host

System hostname as reported by gethostname(). Defaults to `nowhere'.

title

Document title as a string. This is the title specified in the PSPP syntax file.

subtitle

Document subtitle as a string.

source-file

PSPP syntax file name. Example: `mary96/first.stat'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.9 Miscellaneous configuration

The following environment variables can be used to further configure PSPP:

HOME

Used to determine the user's home directory. No default value.

STAT_INCLUDE_PATH

Path used to find include files in PSPP syntax files. Defaults vary across operating systems:

UNIX

  • `.'

  • `~/.pspp/include'

  • `/usr/local/lib/pspp/include'

  • `/usr/lib/pspp/include'

  • `/usr/local/share/pspp/include'

  • `/usr/share/pspp/include'

MS-DOS

  • `.'

  • `C:\PSPP\INCLUDE'

  • `$PATH'

Other OSes
No default path.

STAT_PAGER
PAGER

When PSPP invokes an external pager, it uses the first of these that is defined. There is a default pager only if the person who compiled PSPP defined one.

TERM

The terminal type termcap or ncurses will use, if such support was compiled into PSPP.

STAT_OUTPUT_INIT_FILE

The basename used to search for the driver definition file. See section 5.5 Output devices. See section 5.1 Locating configuration files. Default: devices.

STAT_OUTPUT_PAPERSIZE_FILE

The basename used to search for the papersize file. See section 5.5.5 Paper sizes. See section 5.1 Locating configuration files. Default: papersize.

STAT_OUTPUT_INIT_PATH

The path used to search for the driver definition file and the papersize file. See section 5.1 Locating configuration files. Default: the standard configuration path.

TMPDIR

The sort procedure stores its temporary files in this directory. Default: (UNIX) `/tmp', (MS-DOS) `\', (other OSes) empty string.

TEMP
TMP

Under MS-DOS only, these variables are consulted after TMPDIR, in this order.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.10 Improving output quality

When its drivers are set up properly, PSPP can produce output that looks very good indeed. The PostScript driver, suitably configured, can produce presentation-quality output. Here are a few guidelines for producing better-looking output, regardless of output driver. Your mileage may vary, of course, and everyone has different esthetic preferences.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. Invoking PSPP

 
pspp [ -B dir | --config-dir=dir ] [ -o device | --device=device ]
       [ -d var[=value] | --define=var[=value] ] [-u var | --undef=var ]
       [ -f file | --out-file=file ] [ -p | --pipe ] [ -I- | --no-include ]
       [ -I dir | --include=dir ] [ -i | --interactive ] 
       [ -n | --edit | --dry-run | --just-print | --recon ] 
       [ -r | --no-statrc ] [ -h | --help ] [ -l | --list ] 
       [ -c command | --command command ] [ -s | --safer ]
       [ --testing-mode ] [ -V | --version ] [ -v | --verbose ] 
       [ key=value ] file....

6.1 Non-option Arguments  Specifying syntax files and output devices.
6.2 Configuration Options  Change the configuration for the current run.
6.3 Input and output options  Controlling input and output files.
6.4 Language control options  Language variants.
6.5 Informational options  Helpful information about PSPP.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 Non-option Arguments

Syntax files and output device substitutions can be specified on PSPP's command line:

file

A file by itself on the command line will be executed as a syntax file. PSPP terminates after the syntax file runs, unless the -i or --interactive option is given (see section 6.4 Language control options).

file1 file2

When two or more filenames are given on the command line, the first syntax file is executed, then PSPP's dictionary is cleared, then the second syntax file is executed.

file1 + file2

If syntax files' names are delimited by a plus sign (`+'), then the dictionary is not cleared between their executions, as if they were concatenated together into a single file.

key=value

Defines an output device macro key to expand to value, overriding any macro having the same key defined in the device configuration file. See section 5.5.2 Macro definitions.

There is one other way to specify a syntax file, if your operating system supports it. If you have a syntax file `foobar.stat', put the notation

 
#! /usr/local/bin/pspp

at the top, and mark the file as executable with chmod +x foobar.stat. (If PSPP is not installed in `/usr/local/bin', then insert its actual installation directory into the syntax file instead.) Now you should be able to invoke the syntax file just by typing its name. You can include any options on the command line as usual. PSPP entirely ignores any lines beginning with `#!'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2 Configuration Options

Configuration options are used to change PSPP's configuration for the current run. The configuration options are:

-B dir
--config-dir=dir

Sets the configuration directory to dir. See section 5.1 Locating configuration files.

-o device
--device=device

Selects the output device with name device. If this option is given more than once, then all devices mentioned are selected. This option disables all devices besides those mentioned on the command line.

-d var[=value]
--define=var[=value]

Defines an `environment variable' named var having the optional value value specified. See section 5.4.1 Values of environment variables.

-u var
--undef=var

Undefines the `environment variable' named var. See section 5.4.1 Values of environment variables.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.3 Input and output options

Input and output options affect how PSPP reads input and writes output. These are the input and output options:

-f file
--out-file=file

This overrides the output file name for devices designated as listing devices. If a file named file already exists, it is overwritten.

-p
--pipe

Allows PSPP to be used as a filter by causing the syntax file to be read from stdin and output to be written to stdout. Conflicts with the -f file and --file=file options.

-I-
--no-include

Clears all directories from the include path. This includes all directories put in the include path by default. See section 5.9 Miscellaneous configuration.

-I dir
--include=dir

Appends directory dir to the path that is searched for include files in PSPP syntax files.

-c command
--command=command

Execute literal command command. The command is executed before startup syntax files, if any.

--testing-mode

Invoke heuristics to assist with testing PSPP. For use by make check and similar scripts.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4 Language control options

Language control options control how PSPP syntax files are parsed and interpreted. The available language control options are:

-i
--interactive

When a syntax file is specified on the command line, PSPP normally terminates after processing it. Giving this option will cause PSPP to bring up a command prompt after processing the syntax file.

In addition, this forces syntax files to be interpreted in interactive mode, rather than the default batch mode. See section 5.5.7 How lines are divided into tokens, for information on the differences between batch mode and interactive mode command interpretation.

-n
--edit
--dry-run
--just-print
--recon

Only the syntax of any syntax file specified or of commands entered at the command line is checked. Transformations are not performed and procedures are not executed. Not yet implemented.

-r
--no-statrc

Prevents the execution of the PSPP startup syntax file. Not yet implemented, as startup syntax files aren't, either.

-s
--safer

Disables certain unsafe operations. This includes the ERASE and HOST commands, as well as use of pipes as input and output files.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5 Informational options

Informational options cause information about PSPP to be written to the terminal. Here are the available options:

-h
--help

Prints a message describing PSPP command-line syntax and the available device driver classes, then terminates.

-l
--list

Lists the available device driver classes, then terminates.

-V
--version

Prints a brief message listing PSPP's version, warranties you don't have, copying conditions and copyright, and e-mail address for bug reports, then terminates.

-v
--verbose

Increments PSPP's verbosity level. Higher verbosity levels cause PSPP to display greater amounts of information about what it is doing. Often useful for debugging PSPP's configuration.

This option can be given multiple times to set the verbosity level to that value. The default verbosity level is 0, in which no informational messages will be displayed.

Higher verbosity levels cause messages to be displayed when the corresponding events take place.

1

Driver and subsystem initializations.

2

Completion of driver initializations. Beginning of driver closings.

3

Completion of driver closings.

4

Files searched for; success of searches.

5

Individual directories included in file searches.

Each verbosity level also includes messages from lower verbosity levels.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7. The PSPP language

Please note: PSPP is not even close to completion. Only a few actual statistical procedures are implemented. PSPP is a work in progress.

This chapter discusses elements common to many PSPP commands. Later chapters will describe individual commands in detail.

7.1 Tokens  Characters combine to form tokens.
7.2 Forming commands of tokens  Tokens combine to form commands.
7.3 Types of Commands  Commands come in several flavors.
7.4 Order of Commands  Commands combine to form syntax files.
7.5 Handling missing observations  
7.6 Variables  The unit of data storage.
7.7 Files Used by PSPP  Files used by PSPP.
7.8 Backus-Naur Form  How command syntax is described.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.1 Tokens

PSPP divides most syntax file lines into series of short chunks called tokens, lexical elements, or lexemes. These tokens are then grouped to form commands, each of which tells PSPP to take some action--read in data, write out data, perform a statistical procedure, etc. The process of dividing input into tokens is tokenization, or lexical analysis. Each type of token is described below.

Tokens must be separated from each other by delimiters. Delimiters include whitespace (spaces, tabs, carriage returns, line feeds, vertical tabs), punctuation (commas, forward slashes, etc.), and operators (plus, minus, times, divide, etc.) Note that while whitespace only separates tokens, other delimiters are tokens in themselves.

Identifiers
Identifiers are names that specify variable names, commands, or command details.

Caution: It is legal to end a variable name with a period, but don't do it! The variable name will be misinterpreted when it is the final token on a line: FOO. will be divided into two separate tokens, `FOO' and `.', the terminal dot. See section Forming commands of tokens.

Numbers
Numbers may be specified as integers or reals. Integers are internally converted into reals. Scientific notation is not supported. Here are some examples of valid numbers:

 
1234  3.14159265359  .707106781185  8945.

Caution: The last example will be interpreted as two tokens, `8945' and `.', if it is the last token on a line.

Strings
Strings are literal sequences of characters enclosed in pairs of single quotes (`'') or double quotes (`"').

Hexstrings
Hexstrings are string variants that use hex digits to specify characters.

Punctuation
Punctuation separates tokens; punctuators are delimiters. These are the punctuation characters:

 
,  /  =  (  )

Operators
Operators describe mathematical operations. Some operators are delimiters:

 
(  )  +  -  *  /  **

Many of the above operators are also punctuators. Punctuators are distinguished from operators by context.

The other operators are all reserved keywords. None of these are delimiters:

 
AND  EQ  GE  GT  LE  LT  NE  OR

Terminal Dot
A period (`.') at the end of a line (except for whitespace) is one type of a terminal dot, although not every terminal dot is a period at the end of a line. See section Forming commands of tokens. A period is a terminal dot only when it is at the end of a line; otherwise it is part of a floating-point number. (A period outside a number in the middle of a line is an error.)

Please note: The character used for the terminal dot can be changed with the SET command. This is strongly discouraged, and throughout all the remainder of this manual it will be assumed that the default setting is in effect.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.2 Forming commands of tokens

Most PSPP commands share a common structure, diagrammed below:

 
cmd... [sbc[=][spec [[,]spec]...]] [[/[=][spec [[,]spec]...]]...].

In the above, rather daunting, expression, pairs of square brackets (`[ ]') indicate optional elements, and names such as cmd indicate parts of the syntax that vary from command to command. Ellipses (`...') indicate that the preceding part may be repeated an arbitrary number of times. Let's pick apart what it says above:

PSPP ignores empty commands when they are generated by the above rules. Note that, as a consequence of these rules, each command must begin on a new line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.3 Types of Commands

Commands in PSPP are divided roughly into six categories:

Utility commands
Set or display various global options that affect PSPP operations. May appear anywhere in a syntax file. See section Utility commands.

File definition commands
Give instructions for reading data from text files or from special binary "system files". Most of these commands discard any previous data or variables in order to replace it with the new data and variables. At least one must appear before the first command in any of the categories below. See section 9. Data Input and Output.

Input program commands
Though rarely used, these provide powerful tools for reading data files in arbitrary textual or binary formats. See section 9.7 INPUT PROGRAM.

Transformations
Perform operations on data and write data to output files. Transformations are not carried out until a procedure is executed.

Restricted transformations
Same as transformations for most purposes. See section 7.4 Order of Commands, for a detailed description of the differences.

Procedures
Analyze data, writing results of analyses to the listing file. Cause transformations specified earlier in the file to be performed. In a more general sense, a procedure is any command that causes the active file (the data) to be read.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4 Order of Commands

PSPP does not place many restrictions on ordering of commands. The main restriction is that variables must be defined with one of the file-definition commands before they are otherwise referred to.

Of course, there are specific rules, for those who are interested. PSPP possesses five internal states, called initial, INPUT PROGRAM, FILE TYPE, transformation, and procedure states. (Please note the distinction between the INPUT PROGRAM and FILE TYPE commands and the INPUT PROGRAM and FILE TYPE states.)

PSPP starts up in the initial state. Each successful completion of a command may cause a state transition. Each type of command has its own rules for state transitions:

Utility commands

DATA LIST

INPUT PROGRAM

FILE TYPE

Other file definition commands

Transformations

Restricted transformations

Procedures


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.5 Handling missing observations

PSPP includes special support for unknown numeric data values. Missing observations are assigned a special value, called the system-missing value. This "value" actually indicates the absence of value; it means that the actual value is unknown. Procedures automatically exclude from analyses those observations or cases that have missing values. Whether single observations or entire cases are excluded depends on the procedure.

The system-missing value exists only for numeric variables. String variables always have a defined value, even if it is only a string of spaces.

Variables, whether numeric or string, can have designated user-missing values. Every user-missing value is an actual value for that variable. However, most of the time user-missing values are treated in the same way as the system-missing value. String variables that are wider than a certain width, usually 8 characters (depending on computer architecture), cannot have user-missing values.

For more information on missing values, see the following sections: 7.6 Variables, 11.6 MISSING VALUES, 8. Mathematical Expressions. See also the documentation on individual procedures for information on how they handle missing values.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.6 Variables

Variables are the basic unit of data storage in PSPP. All the variables in a file taken together, apart from any associated data, are said to form a dictionary. Each case contain a value for each variable. Some details of variables are described in the sections below.

7.6.1 Attributes of Variables  Attributes of variables.
7.6.2 Variables Automatically Defined by PSPP  Variables automatically defined by PSPP.
7.6.3 Lists of variable names  
7.6.4 Input and Output Formats  Input and output formats.
7.6.5 Scratch Variables  Variables deleted by procedures.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.6.1 Attributes of Variables

Each variable has a number of attributes, including:

Name
This is an identifier. Each variable must have a different name. See section 7.1 Tokens.

Type
Numeric or string.

Width
(string variables only) String variables with a width of 8 characters or fewer are called short string variables. Short string variables can be used in many procedures where long string variables (those with widths greater than 8) are not allowed.

Please note: Certain systems may consider strings longer than 8 characters to be short strings. Eight characters represents a minimum figure for the maximum length of a short string.

Position
Variables in the dictionary are arranged in a specific order. The DISPLAY command can be used to show this order: see 11.2 DISPLAY.

Orientation
Dexter or sinister. See section 11.5 LEAVE.

Missing values
Optionally, up to three values, or a range of values, or a specific value plus a range, can be specified as user-missing values. There is also a system-missing value that is assigned to an observation when there is no other obvious value for that observation. Observations with missing values are automatically excluded from analyses. User-missing values are actual data values, while the system-missing value is not a value at all. See section 7.5 Handling missing observations.

Variable label
A string that describes the variable. See section 11.13 VARIABLE LABELS.

Value label
Optionally, these associate each possible value of the variable with a string. See section 11.11 VALUE LABELS.

Print format
Display width, format, and (for numeric variables) number of decimal places. This attribute does not affect how data are stored, just how they are displayed. Example: a width of 8, with 2 decimal places. See section 11.9 PRINT FORMATS.

Write format
Similar to print format, but used by certain commands that are designed to write to binary files. See section 11.15 WRITE FORMATS.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.6.2 Variables Automatically Defined by PSPP

There are seven system variables. These are not like ordinary variables, as they are not stored in each case. They can only be used in expressions. These system variables, whose values and output formats cannot be modified, are described below.

$CASENUM
Case number of the case at the moment. This changes as cases are shuffled around.

$DATE
Date the PSPP process was started, in format A9, following the pattern DD MMM YY.

$JDATE
Number of days between 15 Oct 1582 and the time the PSPP process was started.

$LENGTH
Page length, in lines, in format F11.

$SYSMIS
System missing value, in format F1.

$TIME
Number of seconds between midnight 14 Oct 1582 and the time the active file was read, in format F20.

$WIDTH
Page width, in characters, in format F3.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.6.3 Lists of variable names

There are several ways to specify a set of variables:

  1. (Most commonly.) List the variable names one after another, optionally separating them by commas.

  2. (This method cannot be used on commands that define the dictionary, such as DATA LIST.) The syntax is the names of two existed variables, separated by the reserved keyword TO. The meaning is to include every variable in the dictionary between and including the variables specified. For instance, if the dictionary contains six variables with the names ID, X1, X2, GOAL, MET, and NEXTGOAL, in that order, then X2 TO MET would include variables X2, GOAL, and MET.

  3. (This method can be used only on commands that define the dictionary, such as DATA LIST.) It is used to define sequences of variables that end in consecutive integers. The syntax is two identifiers that end in numbers. This method is best illustrated with examples:

    Note that after a set of variables has been defined on DATA LIST or another command with this method, the same set can be referenced on later commands using the same syntax.

  4. The above methods can be combined, either one after another or delimited by commas. For instance, the combined syntax A Q5 TO Q8 X TO Z is legal as long as each part A, Q5 TO Q8, X TO Z is individually legal.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.6.4 Input and Output Formats

Data that PSPP inputs and outputs must have one of a number of formats. These formats are described, in general, by a format specification of the form NAMEw.d, where name is the format name and w is a field width. d is the optional desired number of decimal places, if appropriate. If d is not included then it is assumed to be 0. Some formats do not allow d to be specified.

When an input format is specified on DATA LIST or another command, then it is converted to an output format for the purposes of PRINT and other data output commands. For most purposes, input and output formats are the same; the salient differences are described below.

Below are listed the input and output formats supported by PSPP. If an input format is mapped to a different output format by default, then that mapping is indicated with =>. Each format has the listed bounds on input width (iw) and output width (ow).

The standard numeric input and output formats are given in the following table:

Fw.d: 1 <= iw,ow <= 40
Standard decimal format with d decimal places. If the number is too large to fit within the field width, it is expressed in scientific notation (1.2+34) if w >= 6, with always at least two digits in the exponent. When used as an input format, scientific notation is allowed but an E or an F must be used to introduce the exponent.

The default output format is the same as the input format, except if d > 1. In that case the output w is always made to be at least 2 + d.

Ew.d: 1 <= iw <= 40; 6 <= ow <= 40
For input this is equivalent to F format except that no E or F is require to introduce the exponent. For output, produces scientific notation in the form 1.2+34. There are always at least two digits given in the exponent.

The default output w is the largest of the input w, the input d + 7, and 10. The default output d is the input d, but at least 3.

COMMAw.d: 1 <= iw,ow <= 40
Equivalent to F format, except that groups of three digits are comma-separated on output. If the number is too large to express in the field width, then first commas are eliminated, then if there is still not enough space the number is expressed in scientific notation given that w >= 6. Commas are allowed and ignored when this is used as an input format.

DOTw.d: 1 <= iw,ow <= 40
Equivalent to COMMA format except that the roles of comma and decimal point are interchanged. However: If SET /DECIMAL=DOT is in effect, then COMMA uses `,' for a decimal point and DOT uses `.' for a decimal point.

DOLLARw.d: 1 <= iw <= 40; 2 <= ow <= 40
Equivalent to COMMA format, except that the number is prefixed by a dollar sign (`$') if there is room. On input the value is allowed to be prefixed by a dollar sign, which is ignored.

The default output w is the input w, but at least 2.

PCTw.d: 2 <= iw,ow <= 40
Equivalent to F format, except that the number is suffixed by a percent sign (`%') if there is room. On input the value is allowed to be suffixed by a percent sign, which is ignored.

The default output w is the input w, but at least 2.

Nw.d: 1 <= iw,ow <= 40
Only digits are allowed within the field width. The decimal point is assumed to be d digits from the right margin.

The default output format is F with the same w and d, except if d > 1. In that case the output w is always made to be at least 2 + d.

Zw.d => F: 1 <= iw,ow <= 40
Zoned decimal input. If you need to use this then you know how.

IBw.d => F: 1 <= iw,ow <= 8
Integer binary format. The field is interpreted as a fixed-point positive or negative binary number in two's-complement notation. The location of the decimal point is implied. Endianness is the same as the host machine.

The default output format is F8.2 if d is 0. Otherwise it is F, with output w as 9 + input d and output d as input d.

PIB => F: 1 <= iw,ow <= 8
Positive integer binary format. The field is interpreted as a fixed-point positive binary number. The location of the decimal point is implied. Endianness is teh same as the host machine.

The default output format follows the rules for IB format.

Pw.d => F: 1 <= iw,ow <= 16
Binary coded decimal format. Each byte from left to right, except the rightmost, represents two digits. The upper nibble of each byte is more significant. The upper nibble of the final byte is the least significant digit. The lower nibble of the final byte is the sign; a value of D represents a negative sign and all other values are considered positive. The decimal point is implied.

The default output format follows the rules for IB format.

PKw.d => F: 1 <= iw,ow <= 16
Positive binary code decimal format. Same as P but the last byte is the same as the others.

The default output format follows the rules for IB format.

RBw => F: 2 <= iw,ow <= 8

Binary C architecture-dependent "double" format. For a standard IEEE754 implementation w should be 8.

The default output format follows the rules for IB format.

PIBHEXw.d => F: 2 <= iw,ow <= 16
PIB format encoded as textual hex digit pairs. w must be even.

The input width is mapped to a default output width as follows: 2=>4, 4=>6, 6=>9, 8=>11, 10=>14, 12=>16, 14=>18, 16=>21. No allowances are made for decimal places.

RBHEXw => F: 4 <= iw,ow <= 16

RB format encoded as textual hex digits pairs. w must be even.

The default output format is F8.2.

CCAw.d: 1 <= ow <= 40
CCBw.d: 1 <= ow <= 40
CCCw.d: 1 <= ow <= 40
CCDw.d: 1 <= ow <= 40
CCEw.d: 1 <= ow <= 40

User-defined custom currency formats. May not be used as an input format. See section 16.10 SET, for more details.

The date and time numeric input and output formats accept a number of possible formats. Before describing the formats themselves, some definitions of the elements that make up their formats will be helpful:

leader
All formats accept an optional whitespace leader.

day
An integer between 1 and 31 representing the day of month.

day-count
An integer representing a number of days.

date-delimiter
One or more characters of whitespace or the following characters: - / . ,

month
A month name in one of the following forms:

year
An integer year number between 1582 and 19999, or between 1 and 199. Years between 1 and 199 will have 1900 added.

julian
A single number with a year number in the first 2, 3, or 4 digits (as above) and the day number within the year in the last 3 digits.

quarter
An integer between 1 and 4 representing a quarter.

q-delimiter
The letter `Q' or `q'.

week
An integer between 1 and 53 representing a week within a year.

wk-delimiter
The letters `wk' in any case.

time-delimiter
At least one characters of whitespace or `:' or `.'.

hour
An integer greater than 0 representing an hour.

minute
An integer between 0 and 59 representing a minute within an hour.

opt-second
Optionally, a time-delimiter followed by a real number representing a number of seconds.

hour24
An integer between 0 and 23 representing an hour within a day.

weekday
At least the first two characters of an English day word.

spaces
Any amount or no amount of whitespace.

sign
An optional positive or negative sign.

trailer
All formats accept an optional whitespace trailer.

The date input formats are strung together from the above pieces. On output, the date formats are always printed in a single canonical manner, based on field width. The date input and output formats are described below:

DATEw: 9 <= iw,ow <= 40
Date format. Input format: leader + day + date-delimiter + month + date-delimiter + year + trailer. Output format: DD-MMM-YY for w < 11, DD-MMM-YYYY otherwise.

EDATEw: 8 <= iw,ow <= 40
European date format. Input format same as DATE. Output format: DD.MM.YY for w < 10, DD.MM.YYYY otherwise.

SDATEw: 8 <= iw,ow <= 40
Standard date format. Input format: leader + year + date-delimiter + month + date-delimiter + day + trailer. Output format: YY/MM/DD for w < 10, YYYY/MM/DD otherwise.

ADATEw: 8 <= iw,ow <= 40
American date format. Input format: leader + month + date-delimiter + day + date-delimiter + year + trailer. Output format: MM/DD/YY for w < 10, MM/DD/YYYY otherwise.

JDATEw: 5 <= iw,ow <= 40
Julian date format. Input format: leader + julian + trailer. Output format: YYDDD for w < 7, YYYYDDD otherwise.

QYRw: 4 <= iw <= 40, 6 <= ow <= 40
Quarter/year format. Input format: leader + quarter + q-delimiter + year + trailer. Output format: `Q Q YY', where the first `Q' is one of the digits 1, 2, 3, 4, if w < 8, Q Q YYYY otherwise.

MOYRw: 6 <= iw,ow <= 40
Month/year format. Input format: leader + month + date-delimiter + year + trailer. Output format: `MMM YY' for w < 8, `MMM YYYY' otherwise.

WKYRw: 6 <= iw <= 40, 8 <= ow <= 40
Week/year format. Input format: leader + week + wk-delimiter + year + trailer. Output format: `WW WK YY' for w < 10, `WW WK YYYY' otherwise.

DATETIMEw.d: 17 <= iw,ow <= 40
Date and time format. Input format: leader + day + date-delimiter + month + date-delimiter + yaer + time-delimiter + hour24 + time-delimiter + minute + opt-second. Output format: `DD-MMM-YYYY HH:MM'. If w > 19 then seconds `:SS' is added. If w > 22 and d > 0 then fractional seconds `.SS' are added.

TIMEw.d: 5 <= iw,ow <= 40
Time format. Input format: leader + sign + spaces + hour + time-delimiter + minute + opt-second. Output format: `HH:MM'. Seconds and fractional seconds are available with w of at least 8 and 10, respectively.

DTIMEw.d: 1 <= iw <= 40, 8 <= ow <= 40
Time format with day count. Input format: leader + sign + spaces + day-count + time-delimiter + hour + time-delimiter + minute + opt-second. Output format: `DD HH:MM'. Seconds and fractional seconds are available with w of at least 8 and 10, respectively.

WKDAYw: 2 <= iw,ow <= 40
A weekday as a number between 1 and 7, where 1 is Sunday. Input format: leader + weekday + trailer. Output format: as many characters, in all capital letters, of the English name of the weekday as will fit in the field width.

MONTHw: 3 <= iw,ow <= 40
A month as a number between 1 and 12, where 1 is January. Input format: leader + month + trailer. Output format: as many character, in all capital letters, of the English name of the month as will fit in the field width.

There are only two formats that may be used with string variables:

Aw: 1 <= iw <= 255, 1 <= ow <= 254
The entire field is treated as a string value.

AHEXw => A: 2 <= iw <= 254; 2 <= ow <= 510
The field is composed of characters in a string encoded as textual hex digit pairs.

The default output w is half the input w.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.6.5 Scratch Variables

Most of the time, variables don't retain their values between cases. Instead, either they're being read from a data file or the active file, in which case they assume the value read, or, if created with COMPUTE or another transformation, they're initialized to the system-missing value or to blanks, depending on type.

However, sometimes it's useful to have a variable that keeps its value between cases. You can do this with LEAVE (see section 11.5 LEAVE), or you can use a scratch variable. Scratch variables are variables whose names begin with an octothorpe (`#').

Scratch variables have the same properties as variables left with LEAVE: they retain their values between cases, and for the first case they are initialized to 0 or blanks. They have the additional property that they are deleted before the execution of any procedure. For this reason, scratch variables can't be used for analysis. To obtain the same effect, use COMPUTE (see section 12.3 COMPUTE) to copy the scratch variable's value into an ordinary variable, then analysis that variable.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.7 Files Used by PSPP

PSPP makes use of many files each time it runs. Some of these it reads, some it writes, some it creates. Here is a table listing the most important of these files:

command file
syntax file
These names (synonyms) refer to the file that contains instructions to PSPP that tell it what to do. The syntax file's name is specified on the PSPP command line. Syntax files can also be pulled in with the INCLUDE command.

data file
Data files contain raw data in ASCII format suitable for being read in by the DATA LIST command. Data can be embedded in the syntax file with BEGIN DATA and END DATA commands: this makes the syntax file a data file too.

listing file
One or more output files are created by PSPP each time it is run. The output files receive the tables and charts produced by statistical procedures. The output files may be in any number of formats, depending on how PSPP is configured.

active file
The active file is the "file" on which all PSPP procedures are performed. The active file contains variable definitions and cases. The active file is not necessarily a disk file: it is stored in memory if there is room.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.8 Backus-Naur Form

The syntax of some parts of the PSPP language is presented in this manual using the formalism known as Backus-Naur Form, or BNF. The following table describes BNF:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8. Mathematical Expressions

Some PSPP commands use expressions, which share a common syntax among all PSPP commands. Expressions are made up of operands, which can be numbers, strings, or variable names, separated by operators. There are five types of operators: grouping, arithmetic, logical, relational, and functions.

Every operator takes one or more arguments as input and produces or returns exactly one result as output. Both strings and numeric values can be used as arguments and are produced as results, but each operator accepts only specific combinations of numeric and string values as arguments. With few exceptions, operator arguments may be full-fledged expressions in themselves.

8.1 Boolean values  
8.2 Missing Values in Expressions  Using missing values in expressions.
8.3 Grouping Operators  ( )
8.4 Arithmetic Operators  + - * / **
8.5 Logical Operators  AND NOT OR
8.6 Relational Operators  EQ GE GT LE LT NE
8.7 Functions  More-sophisticated operators.
8.8 Operator Precedence  Operator precedence.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.1 Boolean values

There is a third type for arguments and results, the Boolean type, which is used to represent true/false conditions. Booleans have only three possible values: 0 (false), 1 (true), and system-missing. System-missing is neither true or false.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2 Missing Values in Expressions

String missing values are not treated specially in expressions. Most numeric operators return system-missing when given system-missing arguments. Exceptions are listed under particular operator descriptions.

User-missing values for numeric variables are always transformed into the system-missing value, except inside the arguments to the VALUE, SYSMIS, and MISSING functions.

The missing-value functions can be used to precisely control how missing values are treated in expressions. See section 8.7.4 Missing-Value Functions, for more details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.3 Grouping Operators

Parentheses (`()') are the grouping operators. Surround an expression with parentheses to force early evaluation.

Parentheses also surround the arguments to functions, but in that situation they act as punctuators, not as operators.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.4 Arithmetic Operators

The arithmetic operators take numeric arguments and produce numeric results.

a + b
Adds a and b, returning the sum.

a - b
Subtracts b from a, returning the difference.

a * b
Multiplies a and b, returning the product.

a / b
Divides a by b, returning the quotient. If b is zero, the result is system-missing.

a ** b
Returns the result of raising a to the power b. If a is negative and b is not an integer, the result is system-missing. The result of 0**0 is system-missing as well.

- a
Reverses the sign of a.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5 Logical Operators

The logical operators take logical arguments and produce logical results, meaning "true or false". PSPP logical operators are not true Boolean operators because they may also result in a system-missing value.

a AND b
a & b
True if both a and b are true. However, if one argument is false and the other is missing, the result is false, not missing. If both arguments are missing, the result is missing.

a OR b
a | b
True if at least one of a and b is true. If one argument is true and the other is missing, the result is true, not missing. If both arguments are missing, the result is missing.

NOT a
~ a
True if a is false.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6 Relational Operators

The relational operators take numeric or string arguments and produce Boolean results.

Note that, with numeric arguments, PSPP does not make exact relational tests. Instead, two numbers are considered to be equal even if they differ by a small amount. This amount, epsilon, is dependent on the PSPP configuration and determined at compile time. (The default value is 0.000000001, or 10**(-9).) Use of epsilon allows for round-off errors. Use of epsilon is also idiotic, but the author is not a numeric analyst.

Strings cannot be compared to numbers. When strings of different lengths are compared, the shorter string is right-padded with spaces to match the length of the longer string.

The results of string comparisons, other than tests for equality or inequality, are dependent on the character set in use. String comparisons are case-sensitive.

a EQ b
a = b
True if a is equal to b.

a LE b
a <= b
True if a is less than or equal to b.

a LT b
a < b
True if a is less than b.

a GE b
a >= b
True if a is greater than or equal to b.

a GT b
a > b
True if a is greater than b.

a NE b
a ~= b
a <> b
True is a is not equal to b.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7 Functions

PSPP functions provide mathematical abilities above and beyond those possible using simple operators. Functions have a common syntax: each is composed of a function name followed by a left parenthesis, one or more arguments, and a right parenthesis. Function names are not reserved; their names are specially treated only when followed by a left parenthesis: EXP(10) refers to the constant value e raised to the 10th power, but EXP by itself refers to the value of variable EXP.

The sections below describe each function in detail.

8.7.1 Advanced Mathematical Functions  EXP LG10 LN SQRT
8.7.2 Miscellaneous Mathematical Functions  ABS MOD MOD10 RND TRUNC
8.7.3 Trigonometric Functions  ACOS ARCOS ARSIN ARTAN ASIN ATAN COS SIN TAN
8.7.4 Missing-Value Functions  MISSING NMISS NVALID SYSMIS VALUE
8.7.5 Pseudo-Random Number Generation Functions  NORMAL UNIFORM
8.7.6 Set-Membership Functions  ANY RANGE
8.7.7 Statistical Functions  CFVAR MAX MEAN MIN SD SUM VARIANCE
8.7.8 String Functions  CONCAT INDEX LENGTH LOWER LPAD LTRIM NUMBER RINDEX RPAD RTRIM STRING SUBSTR UPCASE
8.7.9 Time & Date Functions  CTIME.xxx DATE.xxx TIME.xxx XDATE.xxx
8.7.10 Miscellaneous Functions  LAG YRMODA
8.7.11 Functions Not Implemented  CDF.xxx CDFNORM IDF.xxx NCDF.xxx PROBIT RV.xxx


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.1 Advanced Mathematical Functions

Advanced mathematical functions take numeric arguments and produce numeric results.

Function: EXP (exponent)
Returns e (approximately 2.71828) raised to power exponent.

Function: LG10 (number)
Takes the base-10 logarithm of number. If number is not positive, the result is system-missing.

Function: LN (number)
Takes the base-`e' logarithm of number. If number is not positive, the result is system-missing.

Function: SQRT (number)
Takes the square root of number. If number is negative, the result is system-missing.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.2 Miscellaneous Mathematical Functions

Miscellaneous mathematical functions take numeric arguments and produce numeric results.

Function: ABS (number)
Results in the absolute value of number.

Function: MOD (numerator, denominator)
Returns the remainder (modulus) of numerator divided by denominator. If denominator is 0, the result is system-missing. However, if numerator is 0 and denominator is system-missing, the result is 0.

Function: MOD10 (number)
Returns the remainder when number is divided by 10. If number is negative, MOD10(number) is negative or zero.

Function: RND (number)
Takes the absolute value of number and rounds it to an integer. Then, if number was negative originally, negates the result.

Function: TRUNC (number)
Discards the fractional part of number; that is, rounds number towards zero.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.3 Trigonometric Functions

Trigonometric functions take numeric arguments and produce numeric results.

Function: ACOS (number)
Function: ARCOS (number)
Takes the arccosine, in radians, of number. Results in system-missing if number is not between -1 and 1. Portability: none.

Function: ARSIN (number)
Takes the arcsine, in radians, of number. Results in system-missing if number is not between -1 and 1 inclusive.

Function: ARTAN (number)
Takes the arctangent, in radians, of number.

Function: ASIN (number)
Takes the arcsine, in radians, of number. Results in system-missing if number is not between -1 and 1 inclusive. Portability: none.

Function: ATAN (number)
Takes the arctangent, in radians, of number.

Please note: Use of the AR* group of inverse trigonometric functions is recommended over the A* group because they are more portable.

Function: COS (radians)
Takes the cosine of radians.

Function: SIN (angle)
Takes the sine of radians.

Function: TAN (angle)
Takes the tangent of radians. Results in system-missing at values of angle that are too close to odd multiples of pi/2. Portability: none.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.4 Missing-Value Functions

Missing-value functions take various types as arguments, returning various types of results.

Function: MISSING (variable or expression)
num may be a single variable name or an expression. If it is a variable name, results in 1 if the variable has a user-missing or system-missing value for the current case, 0 otherwise. If it is an expression, results in 1 if the expression has the system-missing value, 0 otherwise.

Please note: If the argument is a string expression other than a variable name, MISSING is guaranteed to return 0, because strings do not have a system-missing value. Also, when using a numeric expression argument, remember that user-missing values are converted to the system-missing value in most contexts. Thus, the expressions MISSING(VAR1 op VAR2) and MISSING(VAR1) OR MISSING(VAR2) are often equivalent, depending on the specific operator op used.

Function: NMISS (expr [, expr]...)
Each argument must be a numeric expression. Returns the number of user- or system-missing values in the list. As a special extension, the syntax var1 TO var2 may be used to refer to a range of variables; see 7.6.3 Lists of variable names, for more details.

Function: NVALID (expr [, expr]...)
Each argument must be a numeric expression. Returns the number of values in the list that are not user- or system-missing. As a special extension, the syntax var1 TO var2 may be used to refer to a range of variables; see 7.6.3 Lists of variable names, for more details.

Function: SYSMIS (variable or expression)
When given the name of a numeric variable, returns 1 if the value of that variable is system-missing. Otherwise, if the value is not missing or if it is user-missing, returns 0. If given the name of a string variable, always returns 1. If given an expression other than a single variable name, results in 1 if the value is system- or user-missing, 0 otherwise.

Function: VALUE (variable)
Prevents the user-missing values of variable from being transformed into system-missing values: If variable is not system- or user-missing, results in the value of variable. If variable is user-missing, results in the value of variable anyway. If variable is system-missing, results in system-missing.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.5 Pseudo-Random Number Generation Functions

Pseudo-random number generation functions take numeric arguments and produce numeric results.

The system's C library random generator is used as a basis for generating random numbers, since random number generation is a system-dependent task. However, Knuth's Algorithm B is used to shuffle the resultant values, which is enough to make even a stream of consecutive integers random enough for most applications.

(If you're worried about the quality of the random number generator, well, you're using a statistical processing package--analyze it!)

Function: NORMAL (number)
Results in a random number. Results from NORMAL are normally distributed with a mean of 0 and a standard deviation of number.

Function: UNIFORM (number)
Results in a random number between 0 and number. Results from UNIFORM are evenly distributed across its entire range. There may be a maximum on the largest random number ever generated--this is often 2**31-1 (2,147,483,647), but it may be orders of magnitude higher or lower.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.6 Set-Membership Functions

Set membership functions determine whether a value is a member of a set. They take a set of numeric arguments or a set of string arguments, and produce Boolean results.

String comparisons are performed according to the rules given in 8.6 Relational Operators.

Function: ANY (value, set [, set]...)
Results in true if value is equal to any of the set values. Otherwise, results in false. If value is system-missing, returns system-missing. System-missing values in set do not cause ANY to return system-missing.

Function: RANGE (value, low, high [, low, high]...)
Results in true if value is in any of the intervals bounded by low and high inclusive. Otherwise, results in false. Each low must be less than or equal to its corresponding high value. low and high must be given in pairs. If value is system-missing, returns system-missing. System-missing values in set do not cause RANGE to return system-missing.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.7 Statistical Functions

Statistical functions compute descriptive statistics on a list of values. Some statistics can be computed on numeric or string values; other can only be computed on numeric values. They result in the same type as their arguments.

With statistical functions it is possible to specify a minimum number of non-missing arguments for the function to be evaluated. To do so, append a dot and the number to the function name. For instance, to specify a minimum of three valid arguments to the MEAN function, use the name MEAN.3.

Function: CFVAR (number, number[, ...])
Results in the coefficient of variation of the values of number. This function requires at least two valid arguments to give a non-missing result. (The coefficient of variation is the standard deviation divided by the mean.)

Function: MAX (value, value[, ...])
Results in the value of the greatest value. The values may be numeric or string. Although at least two arguments must be given, only one need be valid for MAX to give a non-missing result.

Function: MEAN (number, number[, ...])
Results in the mean of the values of number. Although at least two arguments must be given, only one need be valid for MEAN to give a non-missing result.

Function: MIN (number, number[, ...])
Results in the value of the least value. The values may be numeric or string. Although at least two arguments must be given, only one need be valid for MAX to give a non-missing result.

Function: SD (number, number[, ...])
Results in the standard deviation of the values of number. This function requires at least two valid arguments to give a non-missing result.

Function: SUM (number, number[, ...])
Results in the sum of the values of number. Although at least two arguments must be given, only one need by valid for SUM to give a non-missing result.

Function: VAR (number, number[, ...])
Results in the variance of the values of number. This function requires at least two valid arguments to give a non-missing result.

Function: VARIANCE (number, number[, ...])
Results in the variance of the values of number. This function requires at least two valid arguments to give a non-missing result. (Use VAR in preference to VARIANCE for reasons of portability.)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.8 String Functions

String functions take various arguments and return various results.

Function: CONCAT (string, string[, ...])
Returns a string consisting of each string in sequence. CONCAT("abc", "def", "ghi") has a value of "abcdefghi". The resultant string is truncated to a maximum of 255 characters.

Function: INDEX (haystack, needle)
Returns a positive integer indicating the position of the first occurrence needle in haystack. Returns 0 if haystack does not contain needle. Returns system-missing if needle is an empty string.

Function: INDEX (haystack, needle, divisor)
Divides needle into parts, each with length divisor. Searches haystack for the first occurrence of each part, and returns the smallest value. Returns 0 if haystack does not contain any part in needle. It is an error if divisor cannot be evenly divided into the length of needle. Returns system-missing if needle is an empty string.

Function: LENGTH (string)
Returns the number of characters in string.

Function: LOWER (string)
Returns a string identical to string except that all uppercase letters are changed to lowercase letters. The definitions of "uppercase" and "lowercase" are system-dependent.

Function: LPAD (string, length)
If string is at least length characters in length, returns string unchanged. Otherwise, returns string padded with spaces on the left side to length length. Returns an empty string if length is system-missing, negative, or greater than 255.

Function: LPAD (string, length, padding)
If string is at least length characters in length, returns string unchanged. Otherwise, returns string padded with padding on the left side to length length. Returns an empty string if length is system-missing, negative, or greater than 255, or if padding does not contain exactly one character.

Function: LTRIM (string)
Returns string, after removing leading spaces. Other whitespace, such as tabs, carriage returns, line feeds, and vertical tabs, is not removed.

Function: LTRIM (string, padding)
Returns string, after removing leading padding characters. If padding does not contain exactly one character, returns an empty string.

Function: NUMBER (string)
Returns the number produced when string is interpreted according to format Fx.0, where x is the number of characters in string. If string does not form a proper number, system-missing is returned without an error message. Portability: none.

Function: NUMBER (string, format)
Returns the number produced when string is interpreted according to format specifier format. Only the number of characters in string specified by format are examined. For example, NUMBER("123", F3.0) and NUMBER("1234", F3.0) both have value 123. If string does not form a proper number, system-missing is returned without an error message.

Function: RINDEX (string, format)
Returns a positive integer indicating the position of the last occurrence of needle in haystack. Returns 0 if haystack does not contain needle. Returns system-missing if needle is an empty string.

Function: RINDEX (haystack, needle, divisor)
Divides needle into parts, each with length divisor. Searches haystack for the last occurrence of each part, and returns the largest value. Returns 0 if haystack does not contain any part in needle. It is an error if divisor cannot be evenly divided into the length of needle. Returns system-missing if needle is an empty string.

Function: RPAD (string, length)
If string is at least length characters in length, returns string unchanged. Otherwise, returns string padded with spaces on the right to length length. Returns an empty string if length is system-missing, negative, or greater than 255.

Function: RPAD (string, length, padding)
If string is at least length characters in length, returns string unchanged. Otherwise, returns string padded with padding on the right to length length. Returns an empty string if length is system-missing, negative, or greater than 255, or if padding does not contain exactly one character.

Function: RTRIM (string)
Returns string, after removing trailing spaces. Other types of whitespace are not removed.

Function: RTRIM (string, padding)
Returns string, after removing trailing padding characters. If padding does not contain exactly one character, returns an empty string.

Function: STRING (number, format)
Returns a string corresponding to number in the format given by format specifier format. For example, STRING(123.56, F5.1) has the value "123.6".

Function: SUBSTR (string, start)
Returns a string consisting of the value of string from position start onward. Returns an empty string if start is system-missing or has a value less than 1 or greater than the number of characters in string.

Function: SUBSTR (string, start, count)
Returns a string consisting of the first count characters from string beginning at position start. Returns an empty string if start or count is system-missing, if start is less than 1 or greater than the number of characters in string, or if count is less than 1. Returns a string shorter than count characters if start + count - 1 is greater than the number of characters in string. Examples: SUBSTR("abcdefg", 3, 2) has value "cd"; SUBSTR("Ben Pfaff", 5, 10) has the value "Pfaff".

Function: UPCASE (string)
Returns string, changing lowercase letters to uppercase letters.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.9 Time & Date Functions

The legal range of dates for use in PSPP is 15 Oct 1582 through 31 Dec 19999.

Please note: Most time & date extraction functions will accept invalid arguments:

However, sensible results are not guaranteed for these invalid values. The given equivalents for these functions are definitely not guaranteed for invalid values.

Please note also: The time & date construction functions do produce reasonable and useful results for out-of-range values; these are not considered invalid.

8.7.9.1 How times & dates are defined and represented  
8.7.9.2 Functions that Produce Times  TIME.{DAYS HMS}
8.7.9.3 Functions that Examine Times  CTIME.{DAYS HOURS MINUTES SECONDS}
8.7.9.4 Functions that Produce Dates  DATE.{DMY MDY MOYR QYR WKYR YRDAY}
8.7.9.5 Functions that Examine Dates  XDATE.{DATE HOUR JDAY MDAY MINUTE MONTH QUARTER SECOND TDAY TIME WEEK WKDAY YEAR}


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.9.1 How times & dates are defined and represented

Times and dates are handled by PSPP as single numbers. A time is an interval. PSPP measures times in seconds. Thus, the following intervals correspond with the numeric values given:
 
          10 minutes                        600
          1 hour                          3,600
          1 day, 3 hours, 10 seconds     97,210
          40 days                     3,456,000
          10010 d, 14 min, 24 s     864,864,864

A date, on the other hand, is a particular instant in the past or the future. PSPP represents a date as a number of seconds after the midnight that separated 8 Oct 1582 and 9 Oct 1582. (Please note that 15 Oct 1582 immediately followed 9 Oct 1582.) Thus, the midnights before the dates given below correspond with the numeric PSPP dates given:

 
              15 Oct 1582                86,400
               4 Jul 1776         6,113,318,400
               1 Jan 1900        10,010,390,400
               1 Oct 1978        12,495,427,200
              24 Aug 1995        13,028,601,600

Please note:

(Adding two dates does not produce a useful result.)

Since times and dates are merely numbers, the ordinary addition and subtraction operators are employed for these purposes.

Please note: Many dates and times have extremely large values--just look at the values above. Thus, it is not a good idea to take powers of these values; also, the accuracy of some procedures may be affected. If necessary, convert times or dates in seconds to some other unit, like days or years, before performing analysis.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.9.2 Functions that Produce Times

These functions take numeric arguments and produce numeric results in PSPP time format.

Function: TIME.DAYS (ndays)
Results in a time value corresponding to ndays days. (TIME.DAYS(x) is equivalent to x * 60 * 60 * 24.)

Function: TIME.HMS (nhours, nmins, nsecs)
Results in a time value corresponding to nhours hours, nmins minutes, and nsecs seconds. (TIME.HMS(h, m, s) is equivalent to h*60*60 + m*60 + s.)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.9.3 Functions that Examine Times

These functions take numeric arguments in PSPP time format and give numeric results.

Function: CTIME.DAYS (time)
Results in the number of days and fractional days in time. (CTIME.DAYS(x) is equivalent to x/60/60/24.)

Function: CTIME.HOURS (time)
Results in the number of hours and fractional hours in time. (CTIME.HOURS(x) is equivalent to x/60/60.)

Function: CTIME.MINUTES (time)
Results in the number of minutes and fractional minutes in time. (CTIME.MINUTES(x) is equivalent to x/60.)

Function: CTIME.SECONDS (time)
Results in the number of seconds and fractional seconds in time. (CTIME.SECONDS does nothing; CTIME.SECONDS(x) is equivalent to x.)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.9.4 Functions that Produce Dates

These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

day
Refers to a day of the month between 1 and 31.

month
Refers to a month of the year between 1 and 12.

quarter
Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

week
Refers to a week of the year between 1 and 53.

yday
Refers to a day of the year between 1 and 366.

year
Refers to a year between 1582 and 19999.

If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

Function: DATE.DMY (day, month, year)
Function: DATE.MDY (month, day, year)
Results in a date value corresponding to the midnight before day day of month month of year year.

Function: DATE.MOYR (month, year)
Results in a date value corresponding to the midnight before the first day of month month of year year.

Function: DATE.QYR (quarter, year)
Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

Function: DATE.WKYR (week, year)
Results in a date value corresponding to the midnight before the first day of week week of year year.

Function: DATE.YRDAY (year, yday)
Results in a date value corresponding to the midnight before day yday of year year.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.9.5 Functions that Examine Dates

These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

date
A numeric value in PSPP date format.

time
A numeric value in PSPP time format.

time-or-date
A numeric value in PSPP time or date format.

Function: XDATE.DATE (time-or-date)
For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

Function: XDATE.HOUR (time-or-date)
For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

Function: XDATE.JDAY(date)
Results in the day of the year (as an integer between 1 and 366) corresponding to date.

Function: XDATE.MDAY(date)
Results in the day of the month (as an integer between 1 and 31) corresponding to date.

Function: XDATE.MINUTE(time-or-date)
Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

Function: XDATE.MONTH(date)
Results in the month of the year (as an integer between 1 and 12) corresponding to date.

Function: XDATE.QUARTER(date)
Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

Function: XDATE.SECOND(time-or-date)
Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

Function: XDATE.TDAY(time)
Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

Function: XDATE.TIME(date)
Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

Function: XDATE.WEEK(date)
Results in the week of the year (as an integer between 1 and 53) corresponding to date.

Function: XDATE.WKDAY(date)
Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

1
Sunday
2
Monday
3
Tuesday
4
Wednesday
5
Thursday
6
Friday
7
Saturday

Function: XDATE.YEAR (date)
Returns the year (as an integer between 1582 and 19999) corresponding to date.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.10 Miscellaneous Functions

Miscellaneous functions take various arguments and produce various results.

Function: LAG (variable)
variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

Function: LAG (variable, ncases)
variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

Function: YRMODA (year, month, day)
year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.11 Functions Not Implemented

These functions are not yet implemented and thus not yet documented, since it's a hassle.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.8 Operator Precedence

The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

  1. ( )
  2. **
  3. -
  4. * /
  5. + -
  6. EQ GEs
    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

    8.7.9.4 Functions that Produce Dates

    These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

    day
    Refers to a day of the month between 1 and 31.

    month
    Refers to a month of the year between 1 and 12.

    quarter
    Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

    week
    Refers to a week of the year between 1 and 53.

    yday
    Refers to a day of the year between 1 and 366.

    year
    Refers to a year between 1582 and 19999.

    If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

    Function: DATE.DMY (day, month, year)
    Function: DATE.MDY (month, day, year)
    Results in a date value corresponding to the midnight before day day of month month of year year.

    Function: DATE.MOYR (month, year)
    Results in a date value corresponding to the midnight before the first day of month month of year year.

    Function: DATE.QYR (quarter, year)
    Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

    Function: DATE.WKYR (week, year)
    Results in a date value corresponding to the midnight before the first day of week week of year year.

    Function: DATE.YRDAY (year, yday)
    Results in a date value corresponding to the midnight before day yday of year year.


    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

    8.7.9.5 Functions that Examine Dates

    These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

    date
    A numeric value in PSPP date format.

    time
    A numeric value in PSPP time format.

    time-or-date
    A numeric value in PSPP time or date format.

    Function: XDATE.DATE (time-or-date)
    For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

    Function: XDATE.HOUR (time-or-date)
    For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

    Function: XDATE.JDAY(date)
    Results in the day of the year (as an integer between 1 and 366) corresponding to date.

    Function: XDATE.MDAY(date)
    Results in the day of the month (as an integer between 1 and 31) corresponding to date.

    Function: XDATE.MINUTE(time-or-date)
    Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

    Function: XDATE.MONTH(date)
    Results in the month of the year (as an integer between 1 and 12) corresponding to date.

    Function: XDATE.QUARTER(date)
    Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

    Function: XDATE.SECOND(time-or-date)
    Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

    Function: XDATE.TDAY(time)
    Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

    Function: XDATE.TIME(date)
    Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

    Function: XDATE.WEEK(date)
    Results in the week of the year (as an integer between 1 and 53) corresponding to date.

    Function: XDATE.WKDAY(date)
    Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

    1
    Sunday
    2
    Monday
    3
    Tuesday
    4
    Wednesday
    5
    Thursday
    6
    Friday
    7
    Saturday

    Function: XDATE.YEAR (date)
    Returns the year (as an integer between 1582 and 19999) corresponding to date.


    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

    8.7.10 Miscellaneous Functions

    Miscellaneous functions take various arguments and produce various results.

    Function: LAG (variable)
    variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

    Function: LAG (variable, ncases)
    variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

    Function: YRMODA (year, month, day)
    year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

    YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

    8.7.11 Functions Not Implemented

    These functions are not yet implemented and thus not yet documented, since it's a hassle.

    • CDF.xxx
    • CDFNORM
    • IDF.xxx
    • NCDF.xxx
    • PROBIT
    • RV.xxx


    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

    8.8 Operator Precedence

    The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

    1. ( )
    2. **
    3. -
    4. * /
    5. + -
    6. EQ GEs
      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

      8.7.9.4 Functions that Produce Dates

      These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

      day
      Refers to a day of the month between 1 and 31.

      month
      Refers to a month of the year between 1 and 12.

      quarter
      Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

      week
      Refers to a week of the year between 1 and 53.

      yday
      Refers to a day of the year between 1 and 366.

      year
      Refers to a year between 1582 and 19999.

      If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

      Function: DATE.DMY (day, month, year)
      Function: DATE.MDY (month, day, year)
      Results in a date value corresponding to the midnight before day day of month month of year year.

      Function: DATE.MOYR (month, year)
      Results in a date value corresponding to the midnight before the first day of month month of year year.

      Function: DATE.QYR (quarter, year)
      Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

      Function: DATE.WKYR (week, year)
      Results in a date value corresponding to the midnight before the first day of week week of year year.

      Function: DATE.YRDAY (year, yday)
      Results in a date value corresponding to the midnight before day yday of year year.


      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

      8.7.9.5 Functions that Examine Dates

      These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

      date
      A numeric value in PSPP date format.

      time
      A numeric value in PSPP time format.

      time-or-date
      A numeric value in PSPP time or date format.

      Function: XDATE.DATE (time-or-date)
      For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

      Function: XDATE.HOUR (time-or-date)
      For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

      Function: XDATE.JDAY(date)
      Results in the day of the year (as an integer between 1 and 366) corresponding to date.

      Function: XDATE.MDAY(date)
      Results in the day of the month (as an integer between 1 and 31) corresponding to date.

      Function: XDATE.MINUTE(time-or-date)
      Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

      Function: XDATE.MONTH(date)
      Results in the month of the year (as an integer between 1 and 12) corresponding to date.

      Function: XDATE.QUARTER(date)
      Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

      Function: XDATE.SECOND(time-or-date)
      Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

      Function: XDATE.TDAY(time)
      Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

      Function: XDATE.TIME(date)
      Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

      Function: XDATE.WEEK(date)
      Results in the week of the year (as an integer between 1 and 53) corresponding to date.

      Function: XDATE.WKDAY(date)
      Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

      1
      Sunday
      2
      Monday
      3
      Tuesday
      4
      Wednesday
      5
      Thursday
      6
      Friday
      7
      Saturday

      Function: XDATE.YEAR (date)
      Returns the year (as an integer between 1582 and 19999) corresponding to date.


      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

      8.7.10 Miscellaneous Functions

      Miscellaneous functions take various arguments and produce various results.

      Function: LAG (variable)
      variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

      Function: LAG (variable, ncases)
      variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

      Function: YRMODA (year, month, day)
      year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

      YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

      8.7.11 Functions Not Implemented

      These functions are not yet implemented and thus not yet documented, since it's a hassle.

      • CDF.xxx
      • CDFNORM
      • IDF.xxx
      • NCDF.xxx
      • PROBIT
      • RV.xxx


      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

      8.8 Operator Precedence

      The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

      1. ( )
      2. **
      3. -
      4. * /
      5. + -
      6. EQ GEs
        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

        8.7.9.4 Functions that Produce Dates

        These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

        day
        Refers to a day of the month between 1 and 31.

        month
        Refers to a month of the year between 1 and 12.

        quarter
        Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

        week
        Refers to a week of the year between 1 and 53.

        yday
        Refers to a day of the year between 1 and 366.

        year
        Refers to a year between 1582 and 19999.

        If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

        Function: DATE.DMY (day, month, year)
        Function: DATE.MDY (month, day, year)
        Results in a date value corresponding to the midnight before day day of month month of year year.

        Function: DATE.MOYR (month, year)
        Results in a date value corresponding to the midnight before the first day of month month of year year.

        Function: DATE.QYR (quarter, year)
        Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

        Function: DATE.WKYR (week, year)
        Results in a date value corresponding to the midnight before the first day of week week of year year.

        Function: DATE.YRDAY (year, yday)
        Results in a date value corresponding to the midnight before day yday of year year.


        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

        8.7.9.5 Functions that Examine Dates

        These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

        date
        A numeric value in PSPP date format.

        time
        A numeric value in PSPP time format.

        time-or-date
        A numeric value in PSPP time or date format.

        Function: XDATE.DATE (time-or-date)
        For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

        Function: XDATE.HOUR (time-or-date)
        For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

        Function: XDATE.JDAY(date)
        Results in the day of the year (as an integer between 1 and 366) corresponding to date.

        Function: XDATE.MDAY(date)
        Results in the day of the month (as an integer between 1 and 31) corresponding to date.

        Function: XDATE.MINUTE(time-or-date)
        Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

        Function: XDATE.MONTH(date)
        Results in the month of the year (as an integer between 1 and 12) corresponding to date.

        Function: XDATE.QUARTER(date)
        Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

        Function: XDATE.SECOND(time-or-date)
        Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

        Function: XDATE.TDAY(time)
        Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

        Function: XDATE.TIME(date)
        Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

        Function: XDATE.WEEK(date)
        Results in the week of the year (as an integer between 1 and 53) corresponding to date.

        Function: XDATE.WKDAY(date)
        Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

        1
        Sunday
        2
        Monday
        3
        Tuesday
        4
        Wednesday
        5
        Thursday
        6
        Friday
        7
        Saturday

        Function: XDATE.YEAR (date)
        Returns the year (as an integer between 1582 and 19999) corresponding to date.


        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

        8.7.10 Miscellaneous Functions

        Miscellaneous functions take various arguments and produce various results.

        Function: LAG (variable)
        variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

        Function: LAG (variable, ncases)
        variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

        Function: YRMODA (year, month, day)
        year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

        YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

        8.7.11 Functions Not Implemented

        These functions are not yet implemented and thus not yet documented, since it's a hassle.

        • CDF.xxx
        • CDFNORM
        • IDF.xxx
        • NCDF.xxx
        • PROBIT
        • RV.xxx


        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

        8.8 Operator Precedence

        The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

        1. ( )
        2. **
        3. -
        4. * /
        5. + -
        6. EQ GEs
          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

          8.7.9.4 Functions that Produce Dates

          These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

          day
          Refers to a day of the month between 1 and 31.

          month
          Refers to a month of the year between 1 and 12.

          quarter
          Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

          week
          Refers to a week of the year between 1 and 53.

          yday
          Refers to a day of the year between 1 and 366.

          year
          Refers to a year between 1582 and 19999.

          If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

          Function: DATE.DMY (day, month, year)
          Function: DATE.MDY (month, day, year)
          Results in a date value corresponding to the midnight before day day of month month of year year.

          Function: DATE.MOYR (month, year)
          Results in a date value corresponding to the midnight before the first day of month month of year year.

          Function: DATE.QYR (quarter, year)
          Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

          Function: DATE.WKYR (week, year)
          Results in a date value corresponding to the midnight before the first day of week week of year year.

          Function: DATE.YRDAY (year, yday)
          Results in a date value corresponding to the midnight before day yday of year year.


          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

          8.7.9.5 Functions that Examine Dates

          These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

          date
          A numeric value in PSPP date format.

          time
          A numeric value in PSPP time format.

          time-or-date
          A numeric value in PSPP time or date format.

          Function: XDATE.DATE (time-or-date)
          For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

          Function: XDATE.HOUR (time-or-date)
          For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

          Function: XDATE.JDAY(date)
          Results in the day of the year (as an integer between 1 and 366) corresponding to date.

          Function: XDATE.MDAY(date)
          Results in the day of the month (as an integer between 1 and 31) corresponding to date.

          Function: XDATE.MINUTE(time-or-date)
          Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

          Function: XDATE.MONTH(date)
          Results in the month of the year (as an integer between 1 and 12) corresponding to date.

          Function: XDATE.QUARTER(date)
          Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

          Function: XDATE.SECOND(time-or-date)
          Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

          Function: XDATE.TDAY(time)
          Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

          Function: XDATE.TIME(date)
          Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

          Function: XDATE.WEEK(date)
          Results in the week of the year (as an integer between 1 and 53) corresponding to date.

          Function: XDATE.WKDAY(date)
          Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

          1
          Sunday
          2
          Monday
          3
          Tuesday
          4
          Wednesday
          5
          Thursday
          6
          Friday
          7
          Saturday

          Function: XDATE.YEAR (date)
          Returns the year (as an integer between 1582 and 19999) corresponding to date.


          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

          8.7.10 Miscellaneous Functions

          Miscellaneous functions take various arguments and produce various results.

          Function: LAG (variable)
          variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

          Function: LAG (variable, ncases)
          variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

          Function: YRMODA (year, month, day)
          year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

          YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

          8.7.11 Functions Not Implemented

          These functions are not yet implemented and thus not yet documented, since it's a hassle.

          • CDF.xxx
          • CDFNORM
          • IDF.xxx
          • NCDF.xxx
          • PROBIT
          • RV.xxx


          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

          8.8 Operator Precedence

          The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

          1. ( )
          2. **
          3. -
          4. * /
          5. + -
          6. EQ GEs
            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

            8.7.9.4 Functions that Produce Dates

            These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

            day
            Refers to a day of the month between 1 and 31.

            month
            Refers to a month of the year between 1 and 12.

            quarter
            Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

            week
            Refers to a week of the year between 1 and 53.

            yday
            Refers to a day of the year between 1 and 366.

            year
            Refers to a year between 1582 and 19999.

            If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

            Function: DATE.DMY (day, month, year)
            Function: DATE.MDY (month, day, year)
            Results in a date value corresponding to the midnight before day day of month month of year year.

            Function: DATE.MOYR (month, year)
            Results in a date value corresponding to the midnight before the first day of month month of year year.

            Function: DATE.QYR (quarter, year)
            Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

            Function: DATE.WKYR (week, year)
            Results in a date value corresponding to the midnight before the first day of week week of year year.

            Function: DATE.YRDAY (year, yday)
            Results in a date value corresponding to the midnight before day yday of year year.


            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

            8.7.9.5 Functions that Examine Dates

            These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

            date
            A numeric value in PSPP date format.

            time
            A numeric value in PSPP time format.

            time-or-date
            A numeric value in PSPP time or date format.

            Function: XDATE.DATE (time-or-date)
            For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

            Function: XDATE.HOUR (time-or-date)
            For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

            Function: XDATE.JDAY(date)
            Results in the day of the year (as an integer between 1 and 366) corresponding to date.

            Function: XDATE.MDAY(date)
            Results in the day of the month (as an integer between 1 and 31) corresponding to date.

            Function: XDATE.MINUTE(time-or-date)
            Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

            Function: XDATE.MONTH(date)
            Results in the month of the year (as an integer between 1 and 12) corresponding to date.

            Function: XDATE.QUARTER(date)
            Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

            Function: XDATE.SECOND(time-or-date)
            Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

            Function: XDATE.TDAY(time)
            Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

            Function: XDATE.TIME(date)
            Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

            Function: XDATE.WEEK(date)
            Results in the week of the year (as an integer between 1 and 53) corresponding to date.

            Function: XDATE.WKDAY(date)
            Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

            1
            Sunday
            2
            Monday
            3
            Tuesday
            4
            Wednesday
            5
            Thursday
            6
            Friday
            7
            Saturday

            Function: XDATE.YEAR (date)
            Returns the year (as an integer between 1582 and 19999) corresponding to date.


            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

            8.7.10 Miscellaneous Functions

            Miscellaneous functions take various arguments and produce various results.

            Function: LAG (variable)
            variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

            Function: LAG (variable, ncases)
            variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

            Function: YRMODA (year, month, day)
            year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

            YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

            8.7.11 Functions Not Implemented

            These functions are not yet implemented and thus not yet documented, since it's a hassle.

            • CDF.xxx
            • CDFNORM
            • IDF.xxx
            • NCDF.xxx
            • PROBIT
            • RV.xxx


            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

            8.8 Operator Precedence

            The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

            1. ( )
            2. **
            3. -
            4. * /
            5. + -
            6. EQ GEs
              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

              8.7.9.4 Functions that Produce Dates

              These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

              day
              Refers to a day of the month between 1 and 31.

              month
              Refers to a month of the year between 1 and 12.

              quarter
              Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

              week
              Refers to a week of the year between 1 and 53.

              yday
              Refers to a day of the year between 1 and 366.

              year
              Refers to a year between 1582 and 19999.

              If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

              Function: DATE.DMY (day, month, year)
              Function: DATE.MDY (month, day, year)
              Results in a date value corresponding to the midnight before day day of month month of year year.

              Function: DATE.MOYR (month, year)
              Results in a date value corresponding to the midnight before the first day of month month of year year.

              Function: DATE.QYR (quarter, year)
              Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

              Function: DATE.WKYR (week, year)
              Results in a date value corresponding to the midnight before the first day of week week of year year.

              Function: DATE.YRDAY (year, yday)
              Results in a date value corresponding to the midnight before day yday of year year.


              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

              8.7.9.5 Functions that Examine Dates

              These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

              date
              A numeric value in PSPP date format.

              time
              A numeric value in PSPP time format.

              time-or-date
              A numeric value in PSPP time or date format.

              Function: XDATE.DATE (time-or-date)
              For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

              Function: XDATE.HOUR (time-or-date)
              For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

              Function: XDATE.JDAY(date)
              Results in the day of the year (as an integer between 1 and 366) corresponding to date.

              Function: XDATE.MDAY(date)
              Results in the day of the month (as an integer between 1 and 31) corresponding to date.

              Function: XDATE.MINUTE(time-or-date)
              Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

              Function: XDATE.MONTH(date)
              Results in the month of the year (as an integer between 1 and 12) corresponding to date.

              Function: XDATE.QUARTER(date)
              Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

              Function: XDATE.SECOND(time-or-date)
              Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

              Function: XDATE.TDAY(time)
              Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

              Function: XDATE.TIME(date)
              Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

              Function: XDATE.WEEK(date)
              Results in the week of the year (as an integer between 1 and 53) corresponding to date.

              Function: XDATE.WKDAY(date)
              Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

              1
              Sunday
              2
              Monday
              3
              Tuesday
              4
              Wednesday
              5
              Thursday
              6
              Friday
              7
              Saturday

              Function: XDATE.YEAR (date)
              Returns the year (as an integer between 1582 and 19999) corresponding to date.


              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

              8.7.10 Miscellaneous Functions

              Miscellaneous functions take various arguments and produce various results.

              Function: LAG (variable)
              variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

              Function: LAG (variable, ncases)
              variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

              Function: YRMODA (year, month, day)
              year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

              YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

              8.7.11 Functions Not Implemented

              These functions are not yet implemented and thus not yet documented, since it's a hassle.

              • CDF.xxx
              • CDFNORM
              • IDF.xxx
              • NCDF.xxx
              • PROBIT
              • RV.xxx


              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

              8.8 Operator Precedence

              The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

              1. ( )
              2. **
              3. -
              4. * /
              5. + -
              6. EQ GEs
                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                8.7.9.4 Functions that Produce Dates

                These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                day
                Refers to a day of the month between 1 and 31.

                month
                Refers to a month of the year between 1 and 12.

                quarter
                Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                week
                Refers to a week of the year between 1 and 53.

                yday
                Refers to a day of the year between 1 and 366.

                year
                Refers to a year between 1582 and 19999.

                If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                Function: DATE.DMY (day, month, year)
                Function: DATE.MDY (month, day, year)
                Results in a date value corresponding to the midnight before day day of month month of year year.

                Function: DATE.MOYR (month, year)
                Results in a date value corresponding to the midnight before the first day of month month of year year.

                Function: DATE.QYR (quarter, year)
                Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                Function: DATE.WKYR (week, year)
                Results in a date value corresponding to the midnight before the first day of week week of year year.

                Function: DATE.YRDAY (year, yday)
                Results in a date value corresponding to the midnight before day yday of year year.


                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                8.7.9.5 Functions that Examine Dates

                These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                date
                A numeric value in PSPP date format.

                time
                A numeric value in PSPP time format.

                time-or-date
                A numeric value in PSPP time or date format.

                Function: XDATE.DATE (time-or-date)
                For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                Function: XDATE.HOUR (time-or-date)
                For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                Function: XDATE.JDAY(date)
                Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                Function: XDATE.MDAY(date)
                Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                Function: XDATE.MINUTE(time-or-date)
                Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                Function: XDATE.MONTH(date)
                Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                Function: XDATE.QUARTER(date)
                Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                Function: XDATE.SECOND(time-or-date)
                Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                Function: XDATE.TDAY(time)
                Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                Function: XDATE.TIME(date)
                Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                Function: XDATE.WEEK(date)
                Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                Function: XDATE.WKDAY(date)
                Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                1
                Sunday
                2
                Monday
                3
                Tuesday
                4
                Wednesday
                5
                Thursday
                6
                Friday
                7
                Saturday

                Function: XDATE.YEAR (date)
                Returns the year (as an integer between 1582 and 19999) corresponding to date.


                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                8.7.10 Miscellaneous Functions

                Miscellaneous functions take various arguments and produce various results.

                Function: LAG (variable)
                variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                Function: LAG (variable, ncases)
                variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                Function: YRMODA (year, month, day)
                year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                8.7.11 Functions Not Implemented

                These functions are not yet implemented and thus not yet documented, since it's a hassle.

                • CDF.xxx
                • CDFNORM
                • IDF.xxx
                • NCDF.xxx
                • PROBIT
                • RV.xxx


                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                8.8 Operator Precedence

                The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                1. ( )
                2. **
                3. -
                4. * /
                5. + -
                6. EQ GEs
                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                  8.7.9.4 Functions that Produce Dates

                  These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                  day
                  Refers to a day of the month between 1 and 31.

                  month
                  Refers to a month of the year between 1 and 12.

                  quarter
                  Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                  week
                  Refers to a week of the year between 1 and 53.

                  yday
                  Refers to a day of the year between 1 and 366.

                  year
                  Refers to a year between 1582 and 19999.

                  If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                  Function: DATE.DMY (day, month, year)
                  Function: DATE.MDY (month, day, year)
                  Results in a date value corresponding to the midnight before day day of month month of year year.

                  Function: DATE.MOYR (month, year)
                  Results in a date value corresponding to the midnight before the first day of month month of year year.

                  Function: DATE.QYR (quarter, year)
                  Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                  Function: DATE.WKYR (week, year)
                  Results in a date value corresponding to the midnight before the first day of week week of year year.

                  Function: DATE.YRDAY (year, yday)
                  Results in a date value corresponding to the midnight before day yday of year year.


                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                  8.7.9.5 Functions that Examine Dates

                  These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                  date
                  A numeric value in PSPP date format.

                  time
                  A numeric value in PSPP time format.

                  time-or-date
                  A numeric value in PSPP time or date format.

                  Function: XDATE.DATE (time-or-date)
                  For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                  Function: XDATE.HOUR (time-or-date)
                  For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                  Function: XDATE.JDAY(date)
                  Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                  Function: XDATE.MDAY(date)
                  Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                  Function: XDATE.MINUTE(time-or-date)
                  Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                  Function: XDATE.MONTH(date)
                  Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                  Function: XDATE.QUARTER(date)
                  Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                  Function: XDATE.SECOND(time-or-date)
                  Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                  Function: XDATE.TDAY(time)
                  Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                  Function: XDATE.TIME(date)
                  Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                  Function: XDATE.WEEK(date)
                  Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                  Function: XDATE.WKDAY(date)
                  Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                  1
                  Sunday
                  2
                  Monday
                  3
                  Tuesday
                  4
                  Wednesday
                  5
                  Thursday
                  6
                  Friday
                  7
                  Saturday

                  Function: XDATE.YEAR (date)
                  Returns the year (as an integer between 1582 and 19999) corresponding to date.


                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                  8.7.10 Miscellaneous Functions

                  Miscellaneous functions take various arguments and produce various results.

                  Function: LAG (variable)
                  variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                  Function: LAG (variable, ncases)
                  variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                  Function: YRMODA (year, month, day)
                  year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                  YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                  8.7.11 Functions Not Implemented

                  These functions are not yet implemented and thus not yet documented, since it's a hassle.

                  • CDF.xxx
                  • CDFNORM
                  • IDF.xxx
                  • NCDF.xxx
                  • PROBIT
                  • RV.xxx


                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                  8.8 Operator Precedence

                  The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                  1. ( )
                  2. **
                  3. -
                  4. * /
                  5. + -
                  6. EQ GEs
                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                    8.7.9.4 Functions that Produce Dates

                    These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                    day
                    Refers to a day of the month between 1 and 31.

                    month
                    Refers to a month of the year between 1 and 12.

                    quarter
                    Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                    week
                    Refers to a week of the year between 1 and 53.

                    yday
                    Refers to a day of the year between 1 and 366.

                    year
                    Refers to a year between 1582 and 19999.

                    If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                    Function: DATE.DMY (day, month, year)
                    Function: DATE.MDY (month, day, year)
                    Results in a date value corresponding to the midnight before day day of month month of year year.

                    Function: DATE.MOYR (month, year)
                    Results in a date value corresponding to the midnight before the first day of month month of year year.

                    Function: DATE.QYR (quarter, year)
                    Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                    Function: DATE.WKYR (week, year)
                    Results in a date value corresponding to the midnight before the first day of week week of year year.

                    Function: DATE.YRDAY (year, yday)
                    Results in a date value corresponding to the midnight before day yday of year year.


                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                    8.7.9.5 Functions that Examine Dates

                    These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                    date
                    A numeric value in PSPP date format.

                    time
                    A numeric value in PSPP time format.

                    time-or-date
                    A numeric value in PSPP time or date format.

                    Function: XDATE.DATE (time-or-date)
                    For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                    Function: XDATE.HOUR (time-or-date)
                    For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                    Function: XDATE.JDAY(date)
                    Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                    Function: XDATE.MDAY(date)
                    Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                    Function: XDATE.MINUTE(time-or-date)
                    Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                    Function: XDATE.MONTH(date)
                    Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                    Function: XDATE.QUARTER(date)
                    Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                    Function: XDATE.SECOND(time-or-date)
                    Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                    Function: XDATE.TDAY(time)
                    Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                    Function: XDATE.TIME(date)
                    Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                    Function: XDATE.WEEK(date)
                    Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                    Function: XDATE.WKDAY(date)
                    Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                    1
                    Sunday
                    2
                    Monday
                    3
                    Tuesday
                    4
                    Wednesday
                    5
                    Thursday
                    6
                    Friday
                    7
                    Saturday

                    Function: XDATE.YEAR (date)
                    Returns the year (as an integer between 1582 and 19999) corresponding to date.


                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                    8.7.10 Miscellaneous Functions

                    Miscellaneous functions take various arguments and produce various results.

                    Function: LAG (variable)
                    variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                    Function: LAG (variable, ncases)
                    variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                    Function: YRMODA (year, month, day)
                    year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                    YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                    8.7.11 Functions Not Implemented

                    These functions are not yet implemented and thus not yet documented, since it's a hassle.

                    • CDF.xxx
                    • CDFNORM
                    • IDF.xxx
                    • NCDF.xxx
                    • PROBIT
                    • RV.xxx


                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                    8.8 Operator Precedence

                    The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                    1. ( )
                    2. **
                    3. -
                    4. * /
                    5. + -
                    6. EQ GEs
                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                      8.7.9.4 Functions that Produce Dates

                      These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                      day
                      Refers to a day of the month between 1 and 31.

                      month
                      Refers to a month of the year between 1 and 12.

                      quarter
                      Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                      week
                      Refers to a week of the year between 1 and 53.

                      yday
                      Refers to a day of the year between 1 and 366.

                      year
                      Refers to a year between 1582 and 19999.

                      If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                      Function: DATE.DMY (day, month, year)
                      Function: DATE.MDY (month, day, year)
                      Results in a date value corresponding to the midnight before day day of month month of year year.

                      Function: DATE.MOYR (month, year)
                      Results in a date value corresponding to the midnight before the first day of month month of year year.

                      Function: DATE.QYR (quarter, year)
                      Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                      Function: DATE.WKYR (week, year)
                      Results in a date value corresponding to the midnight before the first day of week week of year year.

                      Function: DATE.YRDAY (year, yday)
                      Results in a date value corresponding to the midnight before day yday of year year.


                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                      8.7.9.5 Functions that Examine Dates

                      These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                      date
                      A numeric value in PSPP date format.

                      time
                      A numeric value in PSPP time format.

                      time-or-date
                      A numeric value in PSPP time or date format.

                      Function: XDATE.DATE (time-or-date)
                      For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                      Function: XDATE.HOUR (time-or-date)
                      For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                      Function: XDATE.JDAY(date)
                      Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                      Function: XDATE.MDAY(date)
                      Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                      Function: XDATE.MINUTE(time-or-date)
                      Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                      Function: XDATE.MONTH(date)
                      Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                      Function: XDATE.QUARTER(date)
                      Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                      Function: XDATE.SECOND(time-or-date)
                      Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                      Function: XDATE.TDAY(time)
                      Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                      Function: XDATE.TIME(date)
                      Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                      Function: XDATE.WEEK(date)
                      Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                      Function: XDATE.WKDAY(date)
                      Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                      1
                      Sunday
                      2
                      Monday
                      3
                      Tuesday
                      4
                      Wednesday
                      5
                      Thursday
                      6
                      Friday
                      7
                      Saturday

                      Function: XDATE.YEAR (date)
                      Returns the year (as an integer between 1582 and 19999) corresponding to date.


                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                      8.7.10 Miscellaneous Functions

                      Miscellaneous functions take various arguments and produce various results.

                      Function: LAG (variable)
                      variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                      Function: LAG (variable, ncases)
                      variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                      Function: YRMODA (year, month, day)
                      year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                      YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                      8.7.11 Functions Not Implemented

                      These functions are not yet implemented and thus not yet documented, since it's a hassle.

                      • CDF.xxx
                      • CDFNORM
                      • IDF.xxx
                      • NCDF.xxx
                      • PROBIT
                      • RV.xxx


                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                      8.8 Operator Precedence

                      The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                      1. ( )
                      2. **
                      3. -
                      4. * /
                      5. + -
                      6. EQ GEs
                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                        8.7.9.4 Functions that Produce Dates

                        These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                        day
                        Refers to a day of the month between 1 and 31.

                        month
                        Refers to a month of the year between 1 and 12.

                        quarter
                        Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                        week
                        Refers to a week of the year between 1 and 53.

                        yday
                        Refers to a day of the year between 1 and 366.

                        year
                        Refers to a year between 1582 and 19999.

                        If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                        Function: DATE.DMY (day, month, year)
                        Function: DATE.MDY (month, day, year)
                        Results in a date value corresponding to the midnight before day day of month month of year year.

                        Function: DATE.MOYR (month, year)
                        Results in a date value corresponding to the midnight before the first day of month month of year year.

                        Function: DATE.QYR (quarter, year)
                        Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                        Function: DATE.WKYR (week, year)
                        Results in a date value corresponding to the midnight before the first day of week week of year year.

                        Function: DATE.YRDAY (year, yday)
                        Results in a date value corresponding to the midnight before day yday of year year.


                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                        8.7.9.5 Functions that Examine Dates

                        These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                        date
                        A numeric value in PSPP date format.

                        time
                        A numeric value in PSPP time format.

                        time-or-date
                        A numeric value in PSPP time or date format.

                        Function: XDATE.DATE (time-or-date)
                        For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                        Function: XDATE.HOUR (time-or-date)
                        For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                        Function: XDATE.JDAY(date)
                        Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                        Function: XDATE.MDAY(date)
                        Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                        Function: XDATE.MINUTE(time-or-date)
                        Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                        Function: XDATE.MONTH(date)
                        Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                        Function: XDATE.QUARTER(date)
                        Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                        Function: XDATE.SECOND(time-or-date)
                        Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                        Function: XDATE.TDAY(time)
                        Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                        Function: XDATE.TIME(date)
                        Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                        Function: XDATE.WEEK(date)
                        Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                        Function: XDATE.WKDAY(date)
                        Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                        1
                        Sunday
                        2
                        Monday
                        3
                        Tuesday
                        4
                        Wednesday
                        5
                        Thursday
                        6
                        Friday
                        7
                        Saturday

                        Function: XDATE.YEAR (date)
                        Returns the year (as an integer between 1582 and 19999) corresponding to date.


                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                        8.7.10 Miscellaneous Functions

                        Miscellaneous functions take various arguments and produce various results.

                        Function: LAG (variable)
                        variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                        Function: LAG (variable, ncases)
                        variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                        Function: YRMODA (year, month, day)
                        year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                        YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                        8.7.11 Functions Not Implemented

                        These functions are not yet implemented and thus not yet documented, since it's a hassle.

                        • CDF.xxx
                        • CDFNORM
                        • IDF.xxx
                        • NCDF.xxx
                        • PROBIT
                        • RV.xxx


                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                        8.8 Operator Precedence

                        The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                        1. ( )
                        2. **
                        3. -
                        4. * /
                        5. + -
                        6. EQ GEs
                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                          8.7.9.4 Functions that Produce Dates

                          These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                          day
                          Refers to a day of the month between 1 and 31.

                          month
                          Refers to a month of the year between 1 and 12.

                          quarter
                          Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                          week
                          Refers to a week of the year between 1 and 53.

                          yday
                          Refers to a day of the year between 1 and 366.

                          year
                          Refers to a year between 1582 and 19999.

                          If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                          Function: DATE.DMY (day, month, year)
                          Function: DATE.MDY (month, day, year)
                          Results in a date value corresponding to the midnight before day day of month month of year year.

                          Function: DATE.MOYR (month, year)
                          Results in a date value corresponding to the midnight before the first day of month month of year year.

                          Function: DATE.QYR (quarter, year)
                          Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                          Function: DATE.WKYR (week, year)
                          Results in a date value corresponding to the midnight before the first day of week week of year year.

                          Function: DATE.YRDAY (year, yday)
                          Results in a date value corresponding to the midnight before day yday of year year.


                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                          8.7.9.5 Functions that Examine Dates

                          These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                          date
                          A numeric value in PSPP date format.

                          time
                          A numeric value in PSPP time format.

                          time-or-date
                          A numeric value in PSPP time or date format.

                          Function: XDATE.DATE (time-or-date)
                          For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                          Function: XDATE.HOUR (time-or-date)
                          For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                          Function: XDATE.JDAY(date)
                          Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                          Function: XDATE.MDAY(date)
                          Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                          Function: XDATE.MINUTE(time-or-date)
                          Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                          Function: XDATE.MONTH(date)
                          Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                          Function: XDATE.QUARTER(date)
                          Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                          Function: XDATE.SECOND(time-or-date)
                          Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                          Function: XDATE.TDAY(time)
                          Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                          Function: XDATE.TIME(date)
                          Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                          Function: XDATE.WEEK(date)
                          Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                          Function: XDATE.WKDAY(date)
                          Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                          1
                          Sunday
                          2
                          Monday
                          3
                          Tuesday
                          4
                          Wednesday
                          5
                          Thursday
                          6
                          Friday
                          7
                          Saturday

                          Function: XDATE.YEAR (date)
                          Returns the year (as an integer between 1582 and 19999) corresponding to date.


                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                          8.7.10 Miscellaneous Functions

                          Miscellaneous functions take various arguments and produce various results.

                          Function: LAG (variable)
                          variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                          Function: LAG (variable, ncases)
                          variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                          Function: YRMODA (year, month, day)
                          year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                          YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                          8.7.11 Functions Not Implemented

                          These functions are not yet implemented and thus not yet documented, since it's a hassle.

                          • CDF.xxx
                          • CDFNORM
                          • IDF.xxx
                          • NCDF.xxx
                          • PROBIT
                          • RV.xxx


                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                          8.8 Operator Precedence

                          The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                          1. ( )
                          2. **
                          3. -
                          4. * /
                          5. + -
                          6. EQ GEs
                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                            8.7.9.4 Functions that Produce Dates

                            These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                            day
                            Refers to a day of the month between 1 and 31.

                            month
                            Refers to a month of the year between 1 and 12.

                            quarter
                            Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                            week
                            Refers to a week of the year between 1 and 53.

                            yday
                            Refers to a day of the year between 1 and 366.

                            year
                            Refers to a year between 1582 and 19999.

                            If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                            Function: DATE.DMY (day, month, year)
                            Function: DATE.MDY (month, day, year)
                            Results in a date value corresponding to the midnight before day day of month month of year year.

                            Function: DATE.MOYR (month, year)
                            Results in a date value corresponding to the midnight before the first day of month month of year year.

                            Function: DATE.QYR (quarter, year)
                            Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                            Function: DATE.WKYR (week, year)
                            Results in a date value corresponding to the midnight before the first day of week week of year year.

                            Function: DATE.YRDAY (year, yday)
                            Results in a date value corresponding to the midnight before day yday of year year.


                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                            8.7.9.5 Functions that Examine Dates

                            These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                            date
                            A numeric value in PSPP date format.

                            time
                            A numeric value in PSPP time format.

                            time-or-date
                            A numeric value in PSPP time or date format.

                            Function: XDATE.DATE (time-or-date)
                            For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                            Function: XDATE.HOUR (time-or-date)
                            For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                            Function: XDATE.JDAY(date)
                            Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                            Function: XDATE.MDAY(date)
                            Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                            Function: XDATE.MINUTE(time-or-date)
                            Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                            Function: XDATE.MONTH(date)
                            Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                            Function: XDATE.QUARTER(date)
                            Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                            Function: XDATE.SECOND(time-or-date)
                            Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                            Function: XDATE.TDAY(time)
                            Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                            Function: XDATE.TIME(date)
                            Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                            Function: XDATE.WEEK(date)
                            Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                            Function: XDATE.WKDAY(date)
                            Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                            1
                            Sunday
                            2
                            Monday
                            3
                            Tuesday
                            4
                            Wednesday
                            5
                            Thursday
                            6
                            Friday
                            7
                            Saturday

                            Function: XDATE.YEAR (date)
                            Returns the year (as an integer between 1582 and 19999) corresponding to date.


                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                            8.7.10 Miscellaneous Functions

                            Miscellaneous functions take various arguments and produce various results.

                            Function: LAG (variable)
                            variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                            Function: LAG (variable, ncases)
                            variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                            Function: YRMODA (year, month, day)
                            year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                            YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                            8.7.11 Functions Not Implemented

                            These functions are not yet implemented and thus not yet documented, since it's a hassle.

                            • CDF.xxx
                            • CDFNORM
                            • IDF.xxx
                            • NCDF.xxx
                            • PROBIT
                            • RV.xxx


                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                            8.8 Operator Precedence

                            The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                            1. ( )
                            2. **
                            3. -
                            4. * /
                            5. + -
                            6. EQ GEs
                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                              8.7.9.4 Functions that Produce Dates

                              These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                              day
                              Refers to a day of the month between 1 and 31.

                              month
                              Refers to a month of the year between 1 and 12.

                              quarter
                              Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                              week
                              Refers to a week of the year between 1 and 53.

                              yday
                              Refers to a day of the year between 1 and 366.

                              year
                              Refers to a year between 1582 and 19999.

                              If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                              Function: DATE.DMY (day, month, year)
                              Function: DATE.MDY (month, day, year)
                              Results in a date value corresponding to the midnight before day day of month month of year year.

                              Function: DATE.MOYR (month, year)
                              Results in a date value corresponding to the midnight before the first day of month month of year year.

                              Function: DATE.QYR (quarter, year)
                              Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                              Function: DATE.WKYR (week, year)
                              Results in a date value corresponding to the midnight before the first day of week week of year year.

                              Function: DATE.YRDAY (year, yday)
                              Results in a date value corresponding to the midnight before day yday of year year.


                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                              8.7.9.5 Functions that Examine Dates

                              These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                              date
                              A numeric value in PSPP date format.

                              time
                              A numeric value in PSPP time format.

                              time-or-date
                              A numeric value in PSPP time or date format.

                              Function: XDATE.DATE (time-or-date)
                              For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                              Function: XDATE.HOUR (time-or-date)
                              For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                              Function: XDATE.JDAY(date)
                              Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                              Function: XDATE.MDAY(date)
                              Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                              Function: XDATE.MINUTE(time-or-date)
                              Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                              Function: XDATE.MONTH(date)
                              Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                              Function: XDATE.QUARTER(date)
                              Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                              Function: XDATE.SECOND(time-or-date)
                              Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                              Function: XDATE.TDAY(time)
                              Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                              Function: XDATE.TIME(date)
                              Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                              Function: XDATE.WEEK(date)
                              Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                              Function: XDATE.WKDAY(date)
                              Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                              1
                              Sunday
                              2
                              Monday
                              3
                              Tuesday
                              4
                              Wednesday
                              5
                              Thursday
                              6
                              Friday
                              7
                              Saturday

                              Function: XDATE.YEAR (date)
                              Returns the year (as an integer between 1582 and 19999) corresponding to date.


                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                              8.7.10 Miscellaneous Functions

                              Miscellaneous functions take various arguments and produce various results.

                              Function: LAG (variable)
                              variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                              Function: LAG (variable, ncases)
                              variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                              Function: YRMODA (year, month, day)
                              year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                              YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                              8.7.11 Functions Not Implemented

                              These functions are not yet implemented and thus not yet documented, since it's a hassle.

                              • CDF.xxx
                              • CDFNORM
                              • IDF.xxx
                              • NCDF.xxx
                              • PROBIT
                              • RV.xxx


                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                              8.8 Operator Precedence

                              The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                              1. ( )
                              2. **
                              3. -
                              4. * /
                              5. + -
                              6. EQ GEs
                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                8.7.9.4 Functions that Produce Dates

                                These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                day
                                Refers to a day of the month between 1 and 31.

                                month
                                Refers to a month of the year between 1 and 12.

                                quarter
                                Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                week
                                Refers to a week of the year between 1 and 53.

                                yday
                                Refers to a day of the year between 1 and 366.

                                year
                                Refers to a year between 1582 and 19999.

                                If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                Function: DATE.DMY (day, month, year)
                                Function: DATE.MDY (month, day, year)
                                Results in a date value corresponding to the midnight before day day of month month of year year.

                                Function: DATE.MOYR (month, year)
                                Results in a date value corresponding to the midnight before the first day of month month of year year.

                                Function: DATE.QYR (quarter, year)
                                Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                Function: DATE.WKYR (week, year)
                                Results in a date value corresponding to the midnight before the first day of week week of year year.

                                Function: DATE.YRDAY (year, yday)
                                Results in a date value corresponding to the midnight before day yday of year year.


                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                8.7.9.5 Functions that Examine Dates

                                These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                date
                                A numeric value in PSPP date format.

                                time
                                A numeric value in PSPP time format.

                                time-or-date
                                A numeric value in PSPP time or date format.

                                Function: XDATE.DATE (time-or-date)
                                For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                Function: XDATE.HOUR (time-or-date)
                                For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                Function: XDATE.JDAY(date)
                                Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                Function: XDATE.MDAY(date)
                                Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                Function: XDATE.MINUTE(time-or-date)
                                Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                Function: XDATE.MONTH(date)
                                Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                Function: XDATE.QUARTER(date)
                                Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                Function: XDATE.SECOND(time-or-date)
                                Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                Function: XDATE.TDAY(time)
                                Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                Function: XDATE.TIME(date)
                                Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                Function: XDATE.WEEK(date)
                                Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                Function: XDATE.WKDAY(date)
                                Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                1
                                Sunday
                                2
                                Monday
                                3
                                Tuesday
                                4
                                Wednesday
                                5
                                Thursday
                                6
                                Friday
                                7
                                Saturday

                                Function: XDATE.YEAR (date)
                                Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                8.7.10 Miscellaneous Functions

                                Miscellaneous functions take various arguments and produce various results.

                                Function: LAG (variable)
                                variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                Function: LAG (variable, ncases)
                                variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                Function: YRMODA (year, month, day)
                                year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                8.7.11 Functions Not Implemented

                                These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                • CDF.xxx
                                • CDFNORM
                                • IDF.xxx
                                • NCDF.xxx
                                • PROBIT
                                • RV.xxx


                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                8.8 Operator Precedence

                                The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                1. ( )
                                2. **
                                3. -
                                4. * /
                                5. + -
                                6. EQ GEs
                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                  8.7.9.4 Functions that Produce Dates

                                  These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                  day
                                  Refers to a day of the month between 1 and 31.

                                  month
                                  Refers to a month of the year between 1 and 12.

                                  quarter
                                  Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                  week
                                  Refers to a week of the year between 1 and 53.

                                  yday
                                  Refers to a day of the year between 1 and 366.

                                  year
                                  Refers to a year between 1582 and 19999.

                                  If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                  Function: DATE.DMY (day, month, year)
                                  Function: DATE.MDY (month, day, year)
                                  Results in a date value corresponding to the midnight before day day of month month of year year.

                                  Function: DATE.MOYR (month, year)
                                  Results in a date value corresponding to the midnight before the first day of month month of year year.

                                  Function: DATE.QYR (quarter, year)
                                  Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                  Function: DATE.WKYR (week, year)
                                  Results in a date value corresponding to the midnight before the first day of week week of year year.

                                  Function: DATE.YRDAY (year, yday)
                                  Results in a date value corresponding to the midnight before day yday of year year.


                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                  8.7.9.5 Functions that Examine Dates

                                  These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                  date
                                  A numeric value in PSPP date format.

                                  time
                                  A numeric value in PSPP time format.

                                  time-or-date
                                  A numeric value in PSPP time or date format.

                                  Function: XDATE.DATE (time-or-date)
                                  For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                  Function: XDATE.HOUR (time-or-date)
                                  For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                  Function: XDATE.JDAY(date)
                                  Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                  Function: XDATE.MDAY(date)
                                  Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                  Function: XDATE.MINUTE(time-or-date)
                                  Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                  Function: XDATE.MONTH(date)
                                  Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                  Function: XDATE.QUARTER(date)
                                  Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                  Function: XDATE.SECOND(time-or-date)
                                  Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                  Function: XDATE.TDAY(time)
                                  Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                  Function: XDATE.TIME(date)
                                  Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                  Function: XDATE.WEEK(date)
                                  Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                  Function: XDATE.WKDAY(date)
                                  Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                  1
                                  Sunday
                                  2
                                  Monday
                                  3
                                  Tuesday
                                  4
                                  Wednesday
                                  5
                                  Thursday
                                  6
                                  Friday
                                  7
                                  Saturday

                                  Function: XDATE.YEAR (date)
                                  Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                  8.7.10 Miscellaneous Functions

                                  Miscellaneous functions take various arguments and produce various results.

                                  Function: LAG (variable)
                                  variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                  Function: LAG (variable, ncases)
                                  variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                  Function: YRMODA (year, month, day)
                                  year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                  YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                  8.7.11 Functions Not Implemented

                                  These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                  • CDF.xxx
                                  • CDFNORM
                                  • IDF.xxx
                                  • NCDF.xxx
                                  • PROBIT
                                  • RV.xxx


                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                  8.8 Operator Precedence

                                  The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                  1. ( )
                                  2. **
                                  3. -
                                  4. * /
                                  5. + -
                                  6. EQ GEs
                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                    8.7.9.4 Functions that Produce Dates

                                    These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                    day
                                    Refers to a day of the month between 1 and 31.

                                    month
                                    Refers to a month of the year between 1 and 12.

                                    quarter
                                    Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                    week
                                    Refers to a week of the year between 1 and 53.

                                    yday
                                    Refers to a day of the year between 1 and 366.

                                    year
                                    Refers to a year between 1582 and 19999.

                                    If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                    Function: DATE.DMY (day, month, year)
                                    Function: DATE.MDY (month, day, year)
                                    Results in a date value corresponding to the midnight before day day of month month of year year.

                                    Function: DATE.MOYR (month, year)
                                    Results in a date value corresponding to the midnight before the first day of month month of year year.

                                    Function: DATE.QYR (quarter, year)
                                    Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                    Function: DATE.WKYR (week, year)
                                    Results in a date value corresponding to the midnight before the first day of week week of year year.

                                    Function: DATE.YRDAY (year, yday)
                                    Results in a date value corresponding to the midnight before day yday of year year.


                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                    8.7.9.5 Functions that Examine Dates

                                    These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                    date
                                    A numeric value in PSPP date format.

                                    time
                                    A numeric value in PSPP time format.

                                    time-or-date
                                    A numeric value in PSPP time or date format.

                                    Function: XDATE.DATE (time-or-date)
                                    For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                    Function: XDATE.HOUR (time-or-date)
                                    For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                    Function: XDATE.JDAY(date)
                                    Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                    Function: XDATE.MDAY(date)
                                    Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                    Function: XDATE.MINUTE(time-or-date)
                                    Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                    Function: XDATE.MONTH(date)
                                    Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                    Function: XDATE.QUARTER(date)
                                    Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                    Function: XDATE.SECOND(time-or-date)
                                    Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                    Function: XDATE.TDAY(time)
                                    Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                    Function: XDATE.TIME(date)
                                    Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                    Function: XDATE.WEEK(date)
                                    Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                    Function: XDATE.WKDAY(date)
                                    Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                    1
                                    Sunday
                                    2
                                    Monday
                                    3
                                    Tuesday
                                    4
                                    Wednesday
                                    5
                                    Thursday
                                    6
                                    Friday
                                    7
                                    Saturday

                                    Function: XDATE.YEAR (date)
                                    Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                    8.7.10 Miscellaneous Functions

                                    Miscellaneous functions take various arguments and produce various results.

                                    Function: LAG (variable)
                                    variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                    Function: LAG (variable, ncases)
                                    variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                    Function: YRMODA (year, month, day)
                                    year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                    YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                    8.7.11 Functions Not Implemented

                                    These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                    • CDF.xxx
                                    • CDFNORM
                                    • IDF.xxx
                                    • NCDF.xxx
                                    • PROBIT
                                    • RV.xxx


                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                    8.8 Operator Precedence

                                    The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                    1. ( )
                                    2. **
                                    3. -
                                    4. * /
                                    5. + -
                                    6. EQ GEs
                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                      8.7.9.4 Functions that Produce Dates

                                      These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                      day
                                      Refers to a day of the month between 1 and 31.

                                      month
                                      Refers to a month of the year between 1 and 12.

                                      quarter
                                      Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                      week
                                      Refers to a week of the year between 1 and 53.

                                      yday
                                      Refers to a day of the year between 1 and 366.

                                      year
                                      Refers to a year between 1582 and 19999.

                                      If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                      Function: DATE.DMY (day, month, year)
                                      Function: DATE.MDY (month, day, year)
                                      Results in a date value corresponding to the midnight before day day of month month of year year.

                                      Function: DATE.MOYR (month, year)
                                      Results in a date value corresponding to the midnight before the first day of month month of year year.

                                      Function: DATE.QYR (quarter, year)
                                      Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                      Function: DATE.WKYR (week, year)
                                      Results in a date value corresponding to the midnight before the first day of week week of year year.

                                      Function: DATE.YRDAY (year, yday)
                                      Results in a date value corresponding to the midnight before day yday of year year.


                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                      8.7.9.5 Functions that Examine Dates

                                      These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                      date
                                      A numeric value in PSPP date format.

                                      time
                                      A numeric value in PSPP time format.

                                      time-or-date
                                      A numeric value in PSPP time or date format.

                                      Function: XDATE.DATE (time-or-date)
                                      For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                      Function: XDATE.HOUR (time-or-date)
                                      For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                      Function: XDATE.JDAY(date)
                                      Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                      Function: XDATE.MDAY(date)
                                      Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                      Function: XDATE.MINUTE(time-or-date)
                                      Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                      Function: XDATE.MONTH(date)
                                      Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                      Function: XDATE.QUARTER(date)
                                      Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                      Function: XDATE.SECOND(time-or-date)
                                      Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                      Function: XDATE.TDAY(time)
                                      Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                      Function: XDATE.TIME(date)
                                      Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                      Function: XDATE.WEEK(date)
                                      Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                      Function: XDATE.WKDAY(date)
                                      Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                      1
                                      Sunday
                                      2
                                      Monday
                                      3
                                      Tuesday
                                      4
                                      Wednesday
                                      5
                                      Thursday
                                      6
                                      Friday
                                      7
                                      Saturday

                                      Function: XDATE.YEAR (date)
                                      Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                      8.7.10 Miscellaneous Functions

                                      Miscellaneous functions take various arguments and produce various results.

                                      Function: LAG (variable)
                                      variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                      Function: LAG (variable, ncases)
                                      variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                      Function: YRMODA (year, month, day)
                                      year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                      YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                      8.7.11 Functions Not Implemented

                                      These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                      • CDF.xxx
                                      • CDFNORM
                                      • IDF.xxx
                                      • NCDF.xxx
                                      • PROBIT
                                      • RV.xxx


                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                      8.8 Operator Precedence

                                      The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                      1. ( )
                                      2. **
                                      3. -
                                      4. * /
                                      5. + -
                                      6. EQ GEs
                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                        8.7.9.4 Functions that Produce Dates

                                        These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                        day
                                        Refers to a day of the month between 1 and 31.

                                        month
                                        Refers to a month of the year between 1 and 12.

                                        quarter
                                        Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                        week
                                        Refers to a week of the year between 1 and 53.

                                        yday
                                        Refers to a day of the year between 1 and 366.

                                        year
                                        Refers to a year between 1582 and 19999.

                                        If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                        Function: DATE.DMY (day, month, year)
                                        Function: DATE.MDY (month, day, year)
                                        Results in a date value corresponding to the midnight before day day of month month of year year.

                                        Function: DATE.MOYR (month, year)
                                        Results in a date value corresponding to the midnight before the first day of month month of year year.

                                        Function: DATE.QYR (quarter, year)
                                        Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                        Function: DATE.WKYR (week, year)
                                        Results in a date value corresponding to the midnight before the first day of week week of year year.

                                        Function: DATE.YRDAY (year, yday)
                                        Results in a date value corresponding to the midnight before day yday of year year.


                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                        8.7.9.5 Functions that Examine Dates

                                        These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                        date
                                        A numeric value in PSPP date format.

                                        time
                                        A numeric value in PSPP time format.

                                        time-or-date
                                        A numeric value in PSPP time or date format.

                                        Function: XDATE.DATE (time-or-date)
                                        For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                        Function: XDATE.HOUR (time-or-date)
                                        For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                        Function: XDATE.JDAY(date)
                                        Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                        Function: XDATE.MDAY(date)
                                        Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                        Function: XDATE.MINUTE(time-or-date)
                                        Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                        Function: XDATE.MONTH(date)
                                        Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                        Function: XDATE.QUARTER(date)
                                        Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                        Function: XDATE.SECOND(time-or-date)
                                        Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                        Function: XDATE.TDAY(time)
                                        Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                        Function: XDATE.TIME(date)
                                        Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                        Function: XDATE.WEEK(date)
                                        Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                        Function: XDATE.WKDAY(date)
                                        Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                        1
                                        Sunday
                                        2
                                        Monday
                                        3
                                        Tuesday
                                        4
                                        Wednesday
                                        5
                                        Thursday
                                        6
                                        Friday
                                        7
                                        Saturday

                                        Function: XDATE.YEAR (date)
                                        Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                        8.7.10 Miscellaneous Functions

                                        Miscellaneous functions take various arguments and produce various results.

                                        Function: LAG (variable)
                                        variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                        Function: LAG (variable, ncases)
                                        variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                        Function: YRMODA (year, month, day)
                                        year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                        YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                        8.7.11 Functions Not Implemented

                                        These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                        • CDF.xxx
                                        • CDFNORM
                                        • IDF.xxx
                                        • NCDF.xxx
                                        • PROBIT
                                        • RV.xxx


                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                        8.8 Operator Precedence

                                        The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                        1. ( )
                                        2. **
                                        3. -
                                        4. * /
                                        5. + -
                                        6. EQ GEs
                                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                          8.7.9.4 Functions that Produce Dates

                                          These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                          day
                                          Refers to a day of the month between 1 and 31.

                                          month
                                          Refers to a month of the year between 1 and 12.

                                          quarter
                                          Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                          week
                                          Refers to a week of the year between 1 and 53.

                                          yday
                                          Refers to a day of the year between 1 and 366.

                                          year
                                          Refers to a year between 1582 and 19999.

                                          If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                          Function: DATE.DMY (day, month, year)
                                          Function: DATE.MDY (month, day, year)
                                          Results in a date value corresponding to the midnight before day day of month month of year year.

                                          Function: DATE.MOYR (month, year)
                                          Results in a date value corresponding to the midnight before the first day of month month of year year.

                                          Function: DATE.QYR (quarter, year)
                                          Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                          Function: DATE.WKYR (week, year)
                                          Results in a date value corresponding to the midnight before the first day of week week of year year.

                                          Function: DATE.YRDAY (year, yday)
                                          Results in a date value corresponding to the midnight before day yday of year year.


                                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                          8.7.9.5 Functions that Examine Dates

                                          These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                          date
                                          A numeric value in PSPP date format.

                                          time
                                          A numeric value in PSPP time format.

                                          time-or-date
                                          A numeric value in PSPP time or date format.

                                          Function: XDATE.DATE (time-or-date)
                                          For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                          Function: XDATE.HOUR (time-or-date)
                                          For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                          Function: XDATE.JDAY(date)
                                          Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                          Function: XDATE.MDAY(date)
                                          Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                          Function: XDATE.MINUTE(time-or-date)
                                          Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                          Function: XDATE.MONTH(date)
                                          Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                          Function: XDATE.QUARTER(date)
                                          Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                          Function: XDATE.SECOND(time-or-date)
                                          Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                          Function: XDATE.TDAY(time)
                                          Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                          Function: XDATE.TIME(date)
                                          Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                          Function: XDATE.WEEK(date)
                                          Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                          Function: XDATE.WKDAY(date)
                                          Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                          1
                                          Sunday
                                          2
                                          Monday
                                          3
                                          Tuesday
                                          4
                                          Wednesday
                                          5
                                          Thursday
                                          6
                                          Friday
                                          7
                                          Saturday

                                          Function: XDATE.YEAR (date)
                                          Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                          8.7.10 Miscellaneous Functions

                                          Miscellaneous functions take various arguments and produce various results.

                                          Function: LAG (variable)
                                          variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                          Function: LAG (variable, ncases)
                                          variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                          Function: YRMODA (year, month, day)
                                          year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                          YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                          8.7.11 Functions Not Implemented

                                          These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                          • CDF.xxx
                                          • CDFNORM
                                          • IDF.xxx
                                          • NCDF.xxx
                                          • PROBIT
                                          • RV.xxx


                                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                          8.8 Operator Precedence

                                          The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                          1. ( )
                                          2. **
                                          3. -
                                          4. * /
                                          5. + -
                                          6. EQ GEs
                                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                            8.7.9.4 Functions that Produce Dates

                                            These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                            day
                                            Refers to a day of the month between 1 and 31.

                                            month
                                            Refers to a month of the year between 1 and 12.

                                            quarter
                                            Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                            week
                                            Refers to a week of the year between 1 and 53.

                                            yday
                                            Refers to a day of the year between 1 and 366.

                                            year
                                            Refers to a year between 1582 and 19999.

                                            If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                            Function: DATE.DMY (day, month, year)
                                            Function: DATE.MDY (month, day, year)
                                            Results in a date value corresponding to the midnight before day day of month month of year year.

                                            Function: DATE.MOYR (month, year)
                                            Results in a date value corresponding to the midnight before the first day of month month of year year.

                                            Function: DATE.QYR (quarter, year)
                                            Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                            Function: DATE.WKYR (week, year)
                                            Results in a date value corresponding to the midnight before the first day of week week of year year.

                                            Function: DATE.YRDAY (year, yday)
                                            Results in a date value corresponding to the midnight before day yday of year year.


                                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                            8.7.9.5 Functions that Examine Dates

                                            These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                            date
                                            A numeric value in PSPP date format.

                                            time
                                            A numeric value in PSPP time format.

                                            time-or-date
                                            A numeric value in PSPP time or date format.

                                            Function: XDATE.DATE (time-or-date)
                                            For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                            Function: XDATE.HOUR (time-or-date)
                                            For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                            Function: XDATE.JDAY(date)
                                            Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                            Function: XDATE.MDAY(date)
                                            Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                            Function: XDATE.MINUTE(time-or-date)
                                            Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                            Function: XDATE.MONTH(date)
                                            Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                            Function: XDATE.QUARTER(date)
                                            Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                            Function: XDATE.SECOND(time-or-date)
                                            Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                            Function: XDATE.TDAY(time)
                                            Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                            Function: XDATE.TIME(date)
                                            Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                            Function: XDATE.WEEK(date)
                                            Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                            Function: XDATE.WKDAY(date)
                                            Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                            1
                                            Sunday
                                            2
                                            Monday
                                            3
                                            Tuesday
                                            4
                                            Wednesday
                                            5
                                            Thursday
                                            6
                                            Friday
                                            7
                                            Saturday

                                            Function: XDATE.YEAR (date)
                                            Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                            8.7.10 Miscellaneous Functions

                                            Miscellaneous functions take various arguments and produce various results.

                                            Function: LAG (variable)
                                            variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                            Function: LAG (variable, ncases)
                                            variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                            Function: YRMODA (year, month, day)
                                            year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                            YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                            8.7.11 Functions Not Implemented

                                            These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                            • CDF.xxx
                                            • CDFNORM
                                            • IDF.xxx
                                            • NCDF.xxx
                                            • PROBIT
                                            • RV.xxx


                                            [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                            8.8 Operator Precedence

                                            The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                            1. ( )
                                            2. **
                                            3. -
                                            4. * /
                                            5. + -
                                            6. EQ GEs
                                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                              8.7.9.4 Functions that Produce Dates

                                              These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                              day
                                              Refers to a day of the month between 1 and 31.

                                              month
                                              Refers to a month of the year between 1 and 12.

                                              quarter
                                              Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                              week
                                              Refers to a week of the year between 1 and 53.

                                              yday
                                              Refers to a day of the year between 1 and 366.

                                              year
                                              Refers to a year between 1582 and 19999.

                                              If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                              Function: DATE.DMY (day, month, year)
                                              Function: DATE.MDY (month, day, year)
                                              Results in a date value corresponding to the midnight before day day of month month of year year.

                                              Function: DATE.MOYR (month, year)
                                              Results in a date value corresponding to the midnight before the first day of month month of year year.

                                              Function: DATE.QYR (quarter, year)
                                              Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                              Function: DATE.WKYR (week, year)
                                              Results in a date value corresponding to the midnight before the first day of week week of year year.

                                              Function: DATE.YRDAY (year, yday)
                                              Results in a date value corresponding to the midnight before day yday of year year.


                                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                              8.7.9.5 Functions that Examine Dates

                                              These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                              date
                                              A numeric value in PSPP date format.

                                              time
                                              A numeric value in PSPP time format.

                                              time-or-date
                                              A numeric value in PSPP time or date format.

                                              Function: XDATE.DATE (time-or-date)
                                              For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                              Function: XDATE.HOUR (time-or-date)
                                              For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                              Function: XDATE.JDAY(date)
                                              Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                              Function: XDATE.MDAY(date)
                                              Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                              Function: XDATE.MINUTE(time-or-date)
                                              Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                              Function: XDATE.MONTH(date)
                                              Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                              Function: XDATE.QUARTER(date)
                                              Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                              Function: XDATE.SECOND(time-or-date)
                                              Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                              Function: XDATE.TDAY(time)
                                              Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                              Function: XDATE.TIME(date)
                                              Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                              Function: XDATE.WEEK(date)
                                              Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                              Function: XDATE.WKDAY(date)
                                              Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                              1
                                              Sunday
                                              2
                                              Monday
                                              3
                                              Tuesday
                                              4
                                              Wednesday
                                              5
                                              Thursday
                                              6
                                              Friday
                                              7
                                              Saturday

                                              Function: XDATE.YEAR (date)
                                              Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                              8.7.10 Miscellaneous Functions

                                              Miscellaneous functions take various arguments and produce various results.

                                              Function: LAG (variable)
                                              variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                              Function: LAG (variable, ncases)
                                              variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                              Function: YRMODA (year, month, day)
                                              year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                              YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                              8.7.11 Functions Not Implemented

                                              These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                              • CDF.xxx
                                              • CDFNORM
                                              • IDF.xxx
                                              • NCDF.xxx
                                              • PROBIT
                                              • RV.xxx


                                              [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                              8.8 Operator Precedence

                                              The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                              1. ( )
                                              2. **
                                              3. -
                                              4. * /
                                              5. + -
                                              6. EQ GEs
                                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                8.7.9.4 Functions that Produce Dates

                                                These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                                day
                                                Refers to a day of the month between 1 and 31.

                                                month
                                                Refers to a month of the year between 1 and 12.

                                                quarter
                                                Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                                week
                                                Refers to a week of the year between 1 and 53.

                                                yday
                                                Refers to a day of the year between 1 and 366.

                                                year
                                                Refers to a year between 1582 and 19999.

                                                If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                                Function: DATE.DMY (day, month, year)
                                                Function: DATE.MDY (month, day, year)
                                                Results in a date value corresponding to the midnight before day day of month month of year year.

                                                Function: DATE.MOYR (month, year)
                                                Results in a date value corresponding to the midnight before the first day of month month of year year.

                                                Function: DATE.QYR (quarter, year)
                                                Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                                Function: DATE.WKYR (week, year)
                                                Results in a date value corresponding to the midnight before the first day of week week of year year.

                                                Function: DATE.YRDAY (year, yday)
                                                Results in a date value corresponding to the midnight before day yday of year year.


                                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                8.7.9.5 Functions that Examine Dates

                                                These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                                date
                                                A numeric value in PSPP date format.

                                                time
                                                A numeric value in PSPP time format.

                                                time-or-date
                                                A numeric value in PSPP time or date format.

                                                Function: XDATE.DATE (time-or-date)
                                                For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                                Function: XDATE.HOUR (time-or-date)
                                                For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                                Function: XDATE.JDAY(date)
                                                Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                                Function: XDATE.MDAY(date)
                                                Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                                Function: XDATE.MINUTE(time-or-date)
                                                Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                                Function: XDATE.MONTH(date)
                                                Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                                Function: XDATE.QUARTER(date)
                                                Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                                Function: XDATE.SECOND(time-or-date)
                                                Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                                Function: XDATE.TDAY(time)
                                                Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                                Function: XDATE.TIME(date)
                                                Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                                Function: XDATE.WEEK(date)
                                                Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                                Function: XDATE.WKDAY(date)
                                                Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                                1
                                                Sunday
                                                2
                                                Monday
                                                3
                                                Tuesday
                                                4
                                                Wednesday
                                                5
                                                Thursday
                                                6
                                                Friday
                                                7
                                                Saturday

                                                Function: XDATE.YEAR (date)
                                                Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                8.7.10 Miscellaneous Functions

                                                Miscellaneous functions take various arguments and produce various results.

                                                Function: LAG (variable)
                                                variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                                Function: LAG (variable, ncases)
                                                variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                                Function: YRMODA (year, month, day)
                                                year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                                YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                8.7.11 Functions Not Implemented

                                                These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                                • CDF.xxx
                                                • CDFNORM
                                                • IDF.xxx
                                                • NCDF.xxx
                                                • PROBIT
                                                • RV.xxx


                                                [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                8.8 Operator Precedence

                                                The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                                1. ( )
                                                2. **
                                                3. -
                                                4. * /
                                                5. + -
                                                6. EQ GEs
                                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                  8.7.9.4 Functions that Produce Dates

                                                  These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                                  day
                                                  Refers to a day of the month between 1 and 31.

                                                  month
                                                  Refers to a month of the year between 1 and 12.

                                                  quarter
                                                  Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                                  week
                                                  Refers to a week of the year between 1 and 53.

                                                  yday
                                                  Refers to a day of the year between 1 and 366.

                                                  year
                                                  Refers to a year between 1582 and 19999.

                                                  If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                                  Function: DATE.DMY (day, month, year)
                                                  Function: DATE.MDY (month, day, year)
                                                  Results in a date value corresponding to the midnight before day day of month month of year year.

                                                  Function: DATE.MOYR (month, year)
                                                  Results in a date value corresponding to the midnight before the first day of month month of year year.

                                                  Function: DATE.QYR (quarter, year)
                                                  Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                                  Function: DATE.WKYR (week, year)
                                                  Results in a date value corresponding to the midnight before the first day of week week of year year.

                                                  Function: DATE.YRDAY (year, yday)
                                                  Results in a date value corresponding to the midnight before day yday of year year.


                                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                  8.7.9.5 Functions that Examine Dates

                                                  These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                                  date
                                                  A numeric value in PSPP date format.

                                                  time
                                                  A numeric value in PSPP time format.

                                                  time-or-date
                                                  A numeric value in PSPP time or date format.

                                                  Function: XDATE.DATE (time-or-date)
                                                  For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                                  Function: XDATE.HOUR (time-or-date)
                                                  For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                                  Function: XDATE.JDAY(date)
                                                  Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                                  Function: XDATE.MDAY(date)
                                                  Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                                  Function: XDATE.MINUTE(time-or-date)
                                                  Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                                  Function: XDATE.MONTH(date)
                                                  Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                                  Function: XDATE.QUARTER(date)
                                                  Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                                  Function: XDATE.SECOND(time-or-date)
                                                  Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                                  Function: XDATE.TDAY(time)
                                                  Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                                  Function: XDATE.TIME(date)
                                                  Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                                  Function: XDATE.WEEK(date)
                                                  Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                                  Function: XDATE.WKDAY(date)
                                                  Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                                  1
                                                  Sunday
                                                  2
                                                  Monday
                                                  3
                                                  Tuesday
                                                  4
                                                  Wednesday
                                                  5
                                                  Thursday
                                                  6
                                                  Friday
                                                  7
                                                  Saturday

                                                  Function: XDATE.YEAR (date)
                                                  Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                  8.7.10 Miscellaneous Functions

                                                  Miscellaneous functions take various arguments and produce various results.

                                                  Function: LAG (variable)
                                                  variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                                  Function: LAG (variable, ncases)
                                                  variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                                  Function: YRMODA (year, month, day)
                                                  year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                                  YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                  8.7.11 Functions Not Implemented

                                                  These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                                  • CDF.xxx
                                                  • CDFNORM
                                                  • IDF.xxx
                                                  • NCDF.xxx
                                                  • PROBIT
                                                  • RV.xxx


                                                  [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                  8.8 Operator Precedence

                                                  The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                                  1. ( )
                                                  2. **
                                                  3. -
                                                  4. * /
                                                  5. + -
                                                  6. EQ GEs
                                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                    8.7.9.4 Functions that Produce Dates

                                                    These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                                    day
                                                    Refers to a day of the month between 1 and 31.

                                                    month
                                                    Refers to a month of the year between 1 and 12.

                                                    quarter
                                                    Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                                    week
                                                    Refers to a week of the year between 1 and 53.

                                                    yday
                                                    Refers to a day of the year between 1 and 366.

                                                    year
                                                    Refers to a year between 1582 and 19999.

                                                    If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                                    Function: DATE.DMY (day, month, year)
                                                    Function: DATE.MDY (month, day, year)
                                                    Results in a date value corresponding to the midnight before day day of month month of year year.

                                                    Function: DATE.MOYR (month, year)
                                                    Results in a date value corresponding to the midnight before the first day of month month of year year.

                                                    Function: DATE.QYR (quarter, year)
                                                    Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                                    Function: DATE.WKYR (week, year)
                                                    Results in a date value corresponding to the midnight before the first day of week week of year year.

                                                    Function: DATE.YRDAY (year, yday)
                                                    Results in a date value corresponding to the midnight before day yday of year year.


                                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                    8.7.9.5 Functions that Examine Dates

                                                    These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                                    date
                                                    A numeric value in PSPP date format.

                                                    time
                                                    A numeric value in PSPP time format.

                                                    time-or-date
                                                    A numeric value in PSPP time or date format.

                                                    Function: XDATE.DATE (time-or-date)
                                                    For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                                    Function: XDATE.HOUR (time-or-date)
                                                    For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                                    Function: XDATE.JDAY(date)
                                                    Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                                    Function: XDATE.MDAY(date)
                                                    Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                                    Function: XDATE.MINUTE(time-or-date)
                                                    Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                                    Function: XDATE.MONTH(date)
                                                    Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                                    Function: XDATE.QUARTER(date)
                                                    Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                                    Function: XDATE.SECOND(time-or-date)
                                                    Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                                    Function: XDATE.TDAY(time)
                                                    Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                                    Function: XDATE.TIME(date)
                                                    Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                                    Function: XDATE.WEEK(date)
                                                    Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                                    Function: XDATE.WKDAY(date)
                                                    Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                                    1
                                                    Sunday
                                                    2
                                                    Monday
                                                    3
                                                    Tuesday
                                                    4
                                                    Wednesday
                                                    5
                                                    Thursday
                                                    6
                                                    Friday
                                                    7
                                                    Saturday

                                                    Function: XDATE.YEAR (date)
                                                    Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                    8.7.10 Miscellaneous Functions

                                                    Miscellaneous functions take various arguments and produce various results.

                                                    Function: LAG (variable)
                                                    variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                                    Function: LAG (variable, ncases)
                                                    variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                                    Function: YRMODA (year, month, day)
                                                    year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                                    YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                    8.7.11 Functions Not Implemented

                                                    These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                                    • CDF.xxx
                                                    • CDFNORM
                                                    • IDF.xxx
                                                    • NCDF.xxx
                                                    • PROBIT
                                                    • RV.xxx


                                                    [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                    8.8 Operator Precedence

                                                    The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                                    1. ( )
                                                    2. **
                                                    3. -
                                                    4. * /
                                                    5. + -
                                                    6. EQ GEs
                                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                      8.7.9.4 Functions that Produce Dates

                                                      These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                                      day
                                                      Refers to a day of the month between 1 and 31.

                                                      month
                                                      Refers to a month of the year between 1 and 12.

                                                      quarter
                                                      Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                                      week
                                                      Refers to a week of the year between 1 and 53.

                                                      yday
                                                      Refers to a day of the year between 1 and 366.

                                                      year
                                                      Refers to a year between 1582 and 19999.

                                                      If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                                      Function: DATE.DMY (day, month, year)
                                                      Function: DATE.MDY (month, day, year)
                                                      Results in a date value corresponding to the midnight before day day of month month of year year.

                                                      Function: DATE.MOYR (month, year)
                                                      Results in a date value corresponding to the midnight before the first day of month month of year year.

                                                      Function: DATE.QYR (quarter, year)
                                                      Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                                      Function: DATE.WKYR (week, year)
                                                      Results in a date value corresponding to the midnight before the first day of week week of year year.

                                                      Function: DATE.YRDAY (year, yday)
                                                      Results in a date value corresponding to the midnight before day yday of year year.


                                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                      8.7.9.5 Functions that Examine Dates

                                                      These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                                      date
                                                      A numeric value in PSPP date format.

                                                      time
                                                      A numeric value in PSPP time format.

                                                      time-or-date
                                                      A numeric value in PSPP time or date format.

                                                      Function: XDATE.DATE (time-or-date)
                                                      For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                                      Function: XDATE.HOUR (time-or-date)
                                                      For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                                      Function: XDATE.JDAY(date)
                                                      Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                                      Function: XDATE.MDAY(date)
                                                      Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                                      Function: XDATE.MINUTE(time-or-date)
                                                      Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                                      Function: XDATE.MONTH(date)
                                                      Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                                      Function: XDATE.QUARTER(date)
                                                      Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                                      Function: XDATE.SECOND(time-or-date)
                                                      Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                                      Function: XDATE.TDAY(time)
                                                      Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                                      Function: XDATE.TIME(date)
                                                      Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                                      Function: XDATE.WEEK(date)
                                                      Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                                      Function: XDATE.WKDAY(date)
                                                      Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                                      1
                                                      Sunday
                                                      2
                                                      Monday
                                                      3
                                                      Tuesday
                                                      4
                                                      Wednesday
                                                      5
                                                      Thursday
                                                      6
                                                      Friday
                                                      7
                                                      Saturday

                                                      Function: XDATE.YEAR (date)
                                                      Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                      8.7.10 Miscellaneous Functions

                                                      Miscellaneous functions take various arguments and produce various results.

                                                      Function: LAG (variable)
                                                      variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                                      Function: LAG (variable, ncases)
                                                      variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                                      Function: YRMODA (year, month, day)
                                                      year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                                      YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                      8.7.11 Functions Not Implemented

                                                      These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                                      • CDF.xxx
                                                      • CDFNORM
                                                      • IDF.xxx
                                                      • NCDF.xxx
                                                      • PROBIT
                                                      • RV.xxx


                                                      [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                      8.8 Operator Precedence

                                                      The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                                      1. ( )
                                                      2. **
                                                      3. -
                                                      4. * /
                                                      5. + -
                                                      6. EQ GEs
                                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                        8.7.9.4 Functions that Produce Dates

                                                        These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                                        day
                                                        Refers to a day of the month between 1 and 31.

                                                        month
                                                        Refers to a month of the year between 1 and 12.

                                                        quarter
                                                        Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                                        week
                                                        Refers to a week of the year between 1 and 53.

                                                        yday
                                                        Refers to a day of the year between 1 and 366.

                                                        year
                                                        Refers to a year between 1582 and 19999.

                                                        If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                                        Function: DATE.DMY (day, month, year)
                                                        Function: DATE.MDY (month, day, year)
                                                        Results in a date value corresponding to the midnight before day day of month month of year year.

                                                        Function: DATE.MOYR (month, year)
                                                        Results in a date value corresponding to the midnight before the first day of month month of year year.

                                                        Function: DATE.QYR (quarter, year)
                                                        Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                                        Function: DATE.WKYR (week, year)
                                                        Results in a date value corresponding to the midnight before the first day of week week of year year.

                                                        Function: DATE.YRDAY (year, yday)
                                                        Results in a date value corresponding to the midnight before day yday of year year.


                                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                        8.7.9.5 Functions that Examine Dates

                                                        These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                                        date
                                                        A numeric value in PSPP date format.

                                                        time
                                                        A numeric value in PSPP time format.

                                                        time-or-date
                                                        A numeric value in PSPP time or date format.

                                                        Function: XDATE.DATE (time-or-date)
                                                        For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                                        Function: XDATE.HOUR (time-or-date)
                                                        For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                                        Function: XDATE.JDAY(date)
                                                        Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                                        Function: XDATE.MDAY(date)
                                                        Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                                        Function: XDATE.MINUTE(time-or-date)
                                                        Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                                        Function: XDATE.MONTH(date)
                                                        Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                                        Function: XDATE.QUARTER(date)
                                                        Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                                        Function: XDATE.SECOND(time-or-date)
                                                        Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                                        Function: XDATE.TDAY(time)
                                                        Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                                        Function: XDATE.TIME(date)
                                                        Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)*86400.)

                                                        Function: XDATE.WEEK(date)
                                                        Results in the week of the year (as an integer between 1 and 53) corresponding to date.

                                                        Function: XDATE.WKDAY(date)
                                                        Results in the day of week (as an integer between 1 and 7) corresponding to date. The days of the week are:

                                                        1
                                                        Sunday
                                                        2
                                                        Monday
                                                        3
                                                        Tuesday
                                                        4
                                                        Wednesday
                                                        5
                                                        Thursday
                                                        6
                                                        Friday
                                                        7
                                                        Saturday

                                                        Function: XDATE.YEAR (date)
                                                        Returns the year (as an integer between 1582 and 19999) corresponding to date.


                                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                        8.7.10 Miscellaneous Functions

                                                        Miscellaneous functions take various arguments and produce various results.

                                                        Function: LAG (variable)
                                                        variable must be a numeric or string variable name. LAG results in the value of that variable for the case before the current one. In case-selection procedures, LAG results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected.

                                                        Function: LAG (variable, ncases)
                                                        variable must be a numeric or string variable name. ncases must be a small positive constant integer, although there is no explicit limit. (Use of a large value for ncases will increase memory consumption, since PSPP must keep ncases cases in memory.) LAG (variable, ncases results in the value of variable that is ncases before the case currently being processed. See LAG (variable) above for more details.

                                                        Function: YRMODA (year, month, day)
                                                        year is a year between 0 and 199 or 1582 and 19999. month is a month between 1 and 12. day is a day between 1 and 31. If month or day is out-of-range, it changes the next higher unit. For instance, a day of 0 refers to the last day of the previous month, and a month of 13 refers to the first month of the next year. year must be in range. If year is between 0 and 199, 1900 is added. year, month, and day must all be integers.

                                                        YRMODA results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to YRMODA must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.


                                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                        8.7.11 Functions Not Implemented

                                                        These functions are not yet implemented and thus not yet documented, since it's a hassle.

                                                        • CDF.xxx
                                                        • CDFNORM
                                                        • IDF.xxx
                                                        • NCDF.xxx
                                                        • PROBIT
                                                        • RV.xxx


                                                        [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                        8.8 Operator Precedence

                                                        The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are performed from left to right, except for level 2 (exponentiation), where operations are performed from right to left. If an operator appears in the table in two places (-), the first occurrence is unary, the second is binary.

                                                        1. ( )
                                                        2. **
                                                        3. -
                                                        4. * /
                                                        5. + -
                                                        6. EQ GEs
                                                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                          8.7.9.4 Functions that Produce Dates

                                                          These functions take numeric arguments and give numeric results in the PSPP date format. Arguments taken by these functions are:

                                                          day
                                                          Refers to a day of the month between 1 and 31.

                                                          month
                                                          Refers to a month of the year between 1 and 12.

                                                          quarter
                                                          Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first days of months 1, 4, 7, and 10.

                                                          week
                                                          Refers to a week of the year between 1 and 53.

                                                          yday
                                                          Refers to a day of the year between 1 and 366.

                                                          year
                                                          Refers to a year between 1582 and 19999.

                                                          If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero.

                                                          Function: DATE.DMY (day, month, year)
                                                          Function: DATE.MDY (month, day, year)
                                                          Results in a date value corresponding to the midnight before day day of month month of year year.

                                                          Function: DATE.MOYR (month, year)
                                                          Results in a date value corresponding to the midnight before the first day of month month of year year.

                                                          Function: DATE.QYR (quarter, year)
                                                          Results in a date value corresponding to the midnight before the first day of quarter quarter of year year.

                                                          Function: DATE.WKYR (week, year)
                                                          Results in a date value corresponding to the midnight before the first day of week week of year year.

                                                          Function: DATE.YRDAY (year, yday)
                                                          Results in a date value corresponding to the midnight before day yday of year year.


                                                          [ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

                                                          8.7.9.5 Functions that Examine Dates

                                                          These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments:

                                                          date
                                                          A numeric value in PSPP date format.

                                                          time
                                                          A numeric value in PSPP time format.

                                                          time-or-date
                                                          A numeric value in PSPP time or date format.

                                                          Function: XDATE.DATE (time-or-date)
                                                          For a time, results in the time corresponding to the number of whole days date-or-time includes. For a date, results in the date corresponding to the latest midnight at or before date-or-time; that is, gives the date that date-or-time is in. (XDATE.DATE(x) is equivalent to TRUNC(x/86400)*86400.) Applying this function to a time is a Portability: none feature.

                                                          Function: XDATE.HOUR (time-or-date)
                                                          For a time, results in the number of whole hours beyond the number of whole days represented by date-or-time. For a date, results in the hour (as an integer between 0 and 23) corresponding to date-or-time. (XDATE.HOUR(x) is equivalent to MOD(TRUNC(x/3600),24)) Applying this function to a time is a Portability: none feature.

                                                          Function: XDATE.JDAY(date)
                                                          Results in the day of the year (as an integer between 1 and 366) corresponding to date.

                                                          Function: XDATE.MDAY(date)
                                                          Results in the day of the month (as an integer between 1 and 31) corresponding to date.

                                                          Function: XDATE.MINUTE(time-or-date)
                                                          Results in the number of minutes (as an integer between 0 and 59) after the last hour in time-or-date. (XDATE.MINUTE(x) is equivalent to MOD(TRUNC(x/60),60)) Applying this function to a time is a Portability: none feature.

                                                          Function: XDATE.MONTH(date)
                                                          Results in the month of the year (as an integer between 1 and 12) corresponding to date.

                                                          Function: XDATE.QUARTER(date)
                                                          Results in the quarter of the year (as an integer between 1 and 4) corresponding to date.

                                                          Function: XDATE.SECOND(time-or-date)
                                                          Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in time-or-date. (XDATE.SECOND(x) is equivalent to MOD(x, 60).) Applying this function to a time is a Portability: none feature.

                                                          Function: XDATE.TDAY(time)
                                                          Results in the number of whole days (as an integer) in time. (XDATE.TDAY(x) is equivalent to TRUNC(x/86400).)

                                                          Function: XDATE.TIME(date)
                                                          Results in the time of day at the instant corresponding to date, in PSPP time format. This is the number of seconds since midnight on the day corresponding to date. (XDATE.TIME(x) is equivalent to TRUNC(x/86400)