Initialization Tips

Instantiating a Remote Object

try{
/* Instantiate a Remote Object Class Factory object */
Rocf rocf = new Rocf();

/* Instantiate a Connection object */
Connection con = new Connection();

con.setHost("localhost");

MultidimensionalTableV3Interface mi = (MultidimensionalTableV3Interface)rocf.newInstance(MultidimensionalTableV3Interface.class, con);
}

catch ( Exception except ) {};

Initializing with a Different Statistic per Measure

/* Careful, depending on the version of SAS you are using, */
/* the metabase and database names can be case sensitive */

mi.setMetabase("SASHELP");
mi.setDatabase("SASHELP.PRDMDDB");
String col[] = {"Geographic"};
String row[] = {"Time"};
String measure[] = {"ACTUAL", "PREDICT"};
String stat[] = {"SUM", "PCTSUM"};
mi.setColumnAxis(col);
mi.setRowAxis(row);
mi.setSelectedMeasures(measure);

/* Set the statistic for ACTUAL to SUM and PCTSUM */
mi.setSelectedStatistics(measure[0], stat);

/* Set the statistic for PREDICT to SUM and AVG */
stat[1] = "AVG";
mi.setSelectedStatistics(measure[1], stat);
mi.initializeTable();

Initializing Subsets and Totals for Optimal Performance

/* Careful, depending on the version of SAS you are using, */
/* the metabase and database names can be case sensitive */
mi.setMetabase("SASHELP");
mi.setDatabase("SASHELP.PRDMDDB");
String col[] = {"Geographic"};
String row[] = {"Time"};
String measure[] = {"ACTUAL", "PREDICT"};
String stat[] = {"SUM"};

/* Set the subsets and totals before initializing the layout */
/* This will insure that the subset and totals values are */
/* sent to the server along with the layout information rather */
/* than subsequent to it reducing the number of remote method */
/* calls */

Dictionary levels = mi.getAllLevels();
Level level;

/* Error checking should be done to validate that Country is a valid Level and that */
/* Canada and Germany are valid members for Country */

if ( levels.containsKey( "COUNTRY" ))
{
level = (Level)levels.get( "COUNTRY" );

/* Using invalid member values can result in exceptions */
String subsets[] = { "CANADA" , "GERMANY" };
level.setSubset(subsets);
level.setTotalState(true);
level.setTotalLabel( "Totals for Country" );
}
if ( levels.containsKey( "MONTH" ))
{
level = (Level)levels.get( "MONTH" );
level.setTotalState(true);
}

mi.setColumnAxis(col);
mi.setRowAxis(row);
mi.setSelectedMeasures(measure);
mi.setSelectedStatistics(stat);
mi.initializeTable();

Initializing with an Existing SAS/EIS Application

To initialize an existing SAS/EIS application from another SAS/EIS application, use the setApplication method. This method specifies the four-level catalog entry for the application that you want to initialize. For example:

mi.setApplication("SASUSER.SASAPPL.EISAPPL.EIS");

The metabase, database, columnAxis, rowAxis, selectedMeasures and selectedStatistics properties are automatically updated to reflect those of the SAS/EIS application.

The setApplication method replaces setting the individual properties and the initializeTable call.