PARTITION Procedure

OUTPUT Statement

  • OUTPUT OUT=libref.data-table <options>;

The OUTPUT statement creates a data table to contain the sampled observations and stratification information for the sample.

You must specify the following option:

OUT=libref.data-table

names the output data table for PROC PARTITION to use. You must specify this option before any other options. libref.data-table is a two-level name, where

libref

refers to a collection of information that is defined in the LIBNAME statement and includes the library, which includes a path to where the data table is to be stored, and a session identifier, which defaults to the active session but which can be explicitly defined in the LIBNAME statement. For more information about libref, see the section Using CAS Sessions and CAS Engine Librefs.

data-table

specifies the name of the output data table.

This table includes variables that are specified in the COPYVARS= option. In the K-fold partition case, the output includes one more column, _Fold_. In other cases, if you also specify the PARTIND option in the PROC PARTITION statement, the output includes one more column, _PartInd_. In the oversampling case, an additional column, _Freq_, is provided. It is calculated as the ratio of target level’s proportion in the population to its proportion in the sample. _Fold_, _PartInd_ and _Freq_ are reserved names. If they exist in the input data table and you specify them in the COPYVARS= option, you need to use the FOLDNAME=, PARTINDNAME= and FREQNAME= options to change the generated columns’ names.

You can also specify the following options:

COPYVAR=variable
COPYVARS=(variables)

lists one or more variables from the input data table to be transferred to the output data table.

If the COPYVARS= option is not specified, all the variables in the input data table are transferred to the output data table.

FOLDNAME=fold-name

renames the output data table’s _Fold_ column (which is generated when k-fold partitioning is requested) to the specified fold-name.

FREQNAME=freq-name

renames the output data table’s _Freq_ column (which is generated when oversampling is requested) to the specified freq-name.

PARTINDNAME=partition-indicator-name

renames the generated partition indicator, _PartInd_, in the output data table to the specified partition-indicator-name.

SAMPLEFREQNAME=sample-frequency-name

renames the generated sample frequency variable, _SampleFreq_, in the output data table by using the specified sample-frequency-name.

Last updated: June 22, 2026