Tuesday, September 10, 2013

A Sample MaxL Script

     We can automate all the processes modeled in a single MaxL script. This script assumes that the application name is Sample, the database name is Basic, and the calculation script created earlier is named BudInc. It also assumes the load rules generated by the Essbase Studio process are as follows:

  • ACCOUN builds the Account dimension.
  • MARKET builds the Market dimension.
  • PRODUC builds the Product dimension.
  • SCENAR builds the Scenario dimension.
  • YEAR builds the Year dimension.
  • BASIC loads numeric data into the model.


The following script contains commented sections that explain the purpose of each command or block of commands.

/* Create a log file of the process and log into the Essbase sever.*/
spool on to 'c:/MaxL_Logs/output.txt';
login 'admin' 'password';
/* Build the Essbase database using the rules created by Essbase Studio*/
import database sample.basic dimensions
connect as 'admin' identified by 'password' using server rules_file 'ACCOUN',
connect as 'admin' identified by 'password' using server rules_file 'MARKET',
connect as 'admin' identified by 'password' using server rules_file 'PRODUC',
connect as 'admin' identified by 'password' using server rules_file 'SCENAR',
connect as 'admin' identified by 'password' using server rules_file 'YEAR'

on error append to 'C:/MaxL_Error/dimbuild.txt';

/* Load data into the Essbase database using the rule created by Essbase Studio*/
import database sample.basic data
connect as 'admin' identified by 'password' using server rules_file 'BASIC'
on error append to 'C:/MaxL_Error/data.txt';
/* Execute the BudInc calculation script */
Execute calculation sample.basic.budinc;
/* Execute the Top report script*/
export database sample.basic using server report_file 'top.rep' to data_file
'c:/MaxL_Reps/top.txt';
/* Close log file and exit*/
spool off;
exit;

No comments:

Post a Comment