sortd#

Purpose#

Sorts a data file on disk with respect to a specified variable.

Format#

sortd(infile, outfile, keyvar, keytyp)#
Parameters:
  • infile (string) – name of input file.

  • outfile (string) – name of output file, must be different.

  • keyvar (string) – name of key variable.

  • keytyp (scalar) –

    type of key variable.

    1

    numeric key, ascending order.

    2

    character key, ascending order.

    -1

    numeric key, descending order.

    -2

    character key, descending order.

Remarks#

The dataset infile will be sorted on the variable keyvar, and will be placed in outfile.

If the inputs are null (”” or 0), the procedure will ask for them.

Source#

sortd.src

See also

Functions sortmc(), sortc(), sorthc()