BINNING Procedure

OUTPUT Statement

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

The OUTPUT statement enables you to write an output table back to the CAS server by creating an output data table that contains the results of PROC BINNING. For tree-based binning of class inputs, the OUTPUT statement also enables you to write an output bin-mapping data table that contains the following three columns: class input variables, their levels, and their associated bin numbers. If you do not specify the OUTPUT statement, the write-back process is skipped. This is useful when you want only the ODS output. By default, the output table contains the new binned variables. If you specify the COPYVARS= option, the output table contains the "copied variables" and the "binned variables". The output bin-mapping data table contains only three columns, and the COPYVARS= option does not apply to it. If you specify multiple OUTPUT statements, PROC BINNING stops and produces an error message.

Note: If an input variable value is missing, then the binning output level value is 0.

You must specify one of the following options:

OUT=libref.data-table

names the output data table for PROC BINNING to use. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the DATA= option and the section Using CAS Sessions and CAS Engine Librefs.

OUTLEVELBINMAP=libref.data-table

names the output bin-mapping data table for PROC BINNING to use. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the DATA= option and the section Using CAS Sessions and CAS Engine Librefs.

You can also specify the following option:

COPYVAR=variable
COPYVARS=(variables)

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

Last updated: September 22, 2026