SAMPLEFILE Subcommand (CSSELECT command)

SAMPLEFILE is used to write sampled units to an external file or dataset. Datasets are available during the current session but are not available in subsequent sessions unless you explicitly save them as data files.

  • The external file or dataset contains sampled cases only. By default, all variables in the active dataset are copied to the external file or dataset.
  • If SAMPLEFILE is specified, data are not written to the active dataset.
  • SAMPLEFILE must be used if with-replacement sampling is specified in the plan file. Otherwise, an error is generated.
  • KEEP and DROP can be used simultaneously; the effect is cumulative. An error occurs if you specify a variable already named on a previous DROP or one not named on a previous KEEP.