MBANALYSIS Procedure

Getting Started: MBANALYSIS Procedure

Note: Input data must be in a table that is accessible in your session. You can refer to this table by using a two-level name. The first level is a libref, and the second level is the table name. For more information, see the section Using SAS Viya Workbench in Chapter 2, Shared Concepts.

This example finds frequent item sets in the sampsio.assocs data set and generates rules for finding association between those frequent item sets. The sampsio.assocs data set contains 1,000 observations, each of which contains products purchased by a customer.

You can load the sampsio.assocs data set into your SAS library in the following DATA step:

data mylib.assocs;
   set sampsio.assocs;
run;

These statements assume that your SAS libref is named mylib, as in the section Using SAS Viya Workbench, but you can substitute any appropriately defined SAS libref.

The following statements execute the MBANALYSIS procedure on the mylib.assocs data table and generate output in the mylib.out data table:

proc mbanalysis data=mylib.assocs items=3 support=100;
 output out=mylib.out outfreq=mylib.outfreq outrule=mylib.outrule;
 customer Customer;
 target product;
 run;

The PROC MBANALYSIS statement specifies mylib.assocs as the input data table and specifies the rule generation criteria: the number of items and level of support. The OUTPUT statement specifies output tables for storing the results. The CUSTOMER statement identifies Customer as identification variable for the transactions. The TARGET statement defines Product as the target variable.

The procedure stores the list of frequent items in the mylib.outfreq table, the frequent item sets in the mylib.out table, and the generated rules in the mylib.outrule table. The mylib.outrule table contains the rules that are generated for the frequent item sets after rule generation criteria are applied.

Last updated: September 23, 2026