IMSTAT Procedure

Example 1: Partitioning a Table into a Temporary Table

Details

This PROC IMSTAT example demonstrates partitioning a table as it is loaded to memory and then saving it to a temporary table with different partitioning variables.

Program

libname example sasiola host="grid001.example.com" port=10010 tag='hps';

data example.prdsale(partition=(country region)); 1
    set sashelp.prdsale;
run;

proc imstat data=example.prdsale;
    partitioninfo;
    summary actual predict / partition; 2
run;

    /* partition the active table, example.prdsale, by region and prodtype */  
    partition region prodtype; 3
run;
    table example.&_templast_; 4
run;
    partitioninfo;
    summary actual predict / partition; 5
quit;

Program Description

  1. The Prdsale data set is loaded into memory and partitioned by the unique combinations of the formatted values for the Country and Region variables.
  2. The procedure examines the partitioning of the table and requests a summarization of the Actual and Predict variables by the partition values (unique combinations of Country and Region).
  3. In order to accommodate a different data access pattern, the table is partitioned by unique combinations of the Region and Prodtype variables. The table is stored in a temporary table and the name is assigned to the _TEMPLAST_ macro variable.
  4. The TABLE statement references the _TEMPLAST_ macro variable and sets the temporary table as the active table. All statements that follow use the temporary table.
  5. As with the previous SUMMARY statement, the partitioning is examined and the summary is requested for the Actual and Predict variables by the unique combinations of the Region and Prodtype variables.

Output

Partitions for Prdsale When Partitioned by Country and Region
Partitions and properties when partitioned by Country and Region
Summary Statistics for Prdsale When Partitioned by Country and Region
Summary statistics when partitioned by Country and Region
Partitions for Prdsale When Partitioned by Region and Prodtype
Partitions and properties when partitioned by Region and Prodtype
Summary Statistics for Prdsale When Partitioned by Region and Prodtype
Summary statistics when partitioned by Region and Prodtype