This document is intended to explain how to automate data load.
Step.1:
Create a data load rule in Essbase
Step.2 :
Create a Maxl file to execute the load rule
Step .3 :
Create a batch file to execute the MaxL file. We can schedule the Batch file using windows scheduler.
Example of MaxL code.
1.This MaxL code clears the existing data
2.Loads data
3.Aggregates the data.
Remember : You need clear the data before you load. We clear the data because of our requirements. You can just use step 2 and 3 load data and aggregate data.
/*Script Start */
/*Login */
LOGIN 'UserName' 'Password' ON 'Server Name';
/*Clears data */
execute calculation '
Fix (@idescendants("Account"),@idescendants(Entity),&Current Year,Version)
CLEARDATA Scenario;
Endfix;'
on ApplicationName.Database Name;
/* Imports Data */
import database 'ApplicationName'.'DatabaseName' data connect as 'UserName' identified by 'Password' using server rules_file 'LoadRuleName' on error
write to 'e:\\Logs\Errorfilename.err';
/*Aggregates Data*/
execute calculation'
SET AGGMISSG ON;
SET UPDATECALC OFF;
Fix (Scenario,Year,Version)
CALC DIM(Product,Entity);
Endfix;'
on ApplicationName.DatabaseName;
LOGOUT;
EXIT;
/*End MaxL Script*/
Batch File to call the MaxL Script and send email about status of the
Rem ******************************************************************************
Rem Object Type: Batch File
Rem Object Name: BatchFileName.bat
Rem Script Date: 01-27-2009
Rem Created by: Dornakal
Rem Purpose: This script loads the following data into Cube
Rem Changed By:
Rem Change Date:
Rem Description:
Rem ******************************************************************************
Rem This starts the log file
echo "Start of log" > E:\Logs\Dataload.log
Rem This calls MaxL script to load data
essmsh E:\Scripts\MaxL \DataLoad.mxl >> E:\Logs\Dataload.log
Rem Send mail about the status of the job
sendmail -b E:\Logs\Dataload.log -s "Subject of the mail (data load status)." -f Sendersemail -r Recievers email -r Receiver’s email -X HQSMTP.yourcompany.net