Data Export Batch
Data Export Batch
The Data_Utility
The example I will use comes from an environment that had five separate ASO cubes. The
cubes had similar structure (same dimension names, same scenarios, same time and period
dimensions). The load rules used to load data into the cubes are the same in all the cubes.
They all use the same data files and load only the data that applies to each individual cube.
In this environment, I built a utility to clear and load data into the cubes. The utility included
two files:
1. bat
2. mxl
The complete text of both files is provided at the end of this post.
To use the utility, a user would launch the Data_Utility.bat file. This file asks the user to
respond to a number for simple questions:
After the user would make appropriate responses, the batch file launches the MaxL script
which performs the following operations:
Combining the Batch file and the MaxL script allows the end user to interact with Essbase
without going into the EAS. This allows the end user to perform administrative actions
without actually having access to administrative consol. In some organizations, this can be a
big win for both the end user and the admin staff.
Before starting to interact with the user, it is a good idea to clean up the cmd window so that
the user only sees information that is pertinent to the task at hand. Long paths and other
commands lines can muck up the screen and make it hard for the user to make quick and easy
decisions. The following lines clear up the CMD window and set the path to the D: drive:
@echo off
cls
D:
This section sets up a date and time stamp. This can stamp can be used in log and error file
names for reference purposes.
rem
set
set
set
The echo command can be used to display information on the screen. In the following
example, it is used to define a title in the CMD window. This title is not necessary, but it
provides a context to for the user:
echo *********************************
echo ***** TopDown ASO Data Utility ******
echo *********************************
Next, display the first set of options for the user to choose from. In this case, the user can
choose the type of data to load. The options are Actuals, Budget, and Forecast. In this case,
the options are the same as the members of the Scenario dimension.
echo.
echo Please select the data you want to load:
echo.
echo A. Actuals
echo.
echo B. Budget
echo.
echo F. Forecast
echo.
The above section, combined with the title section before it will look like this:
The following line allows the user to respond to the question above by entering a keystroke.
In this case, the user can only respond with pressing one of the following keys: A, B, or
F:
choice /C:ABF /M "-->> Enter a letter for the data you want to clear and
load: "%1
After the user responds by pressing a valid key, the program performs a series of actions
depending on the users response.
If the user pressed the A key, the software will set the DataType variable to Actual, and
the MTDRule variable to FY_MTD. The GoToCubSelection line skips the settings for Budget
and Forecast.
:IsActual
Set DataType=Actual
Set MTDRule=FY_MTD
GoTo CubeSeclection
If the user pressed the B key, the software will set the DataType variable to Budget, and
the MTDRule variable to FY_MTDB. The GoToCubSelection line skips the settings for
Forecast.
:IsBudget
Set DataType=Budget
Set MTDRule=FY_MTDB
GoTo CubeSeclection
If the user pressed the F key, the software will set the DataType variable to Forecast, and
the MTDRule variable to FY_MTDF. The GoToCubSelection line skips the settings for
Forecast.
:IsForecast
Set DataType=F1
Set MTDRule=FY_MTDF
GoTo CubeSeclection
The variables are used by the MaxL script to launch clear data (DataType). In this
application, Essbase uses different load rules for each data type. This makes it necessary to
set the variable MTDRule so that the MaxL script can use the proper load rule when loading
the data.
Another way to let the user pick options is to set the variables directly after ERRORLEVEL
check. In the following example, the code asks the user to pick a cube, and then sets the
variable CubeName to the appropriate name based on the users response:
:CubeSeclection
cls
echo.
echo Please select a cube:
echo.
echo X. ALL
echo.
echo A. AcctASI
echo.
echo C.
echo.
echo F.
echo.
echo G.
echo.
echo L.
echo.
AcctCON
AcctFDN
AcctGRP
AcctLCE
The command to let the user pick the cube is the same command used in the previous
section:
choice /C:XACFGL /M >> Enter a letter for the cube you want to load: %2
However, since the script is only setting one variable, that section is much more simple than
the one used in the previous section:
IF
IF
IF
IF
IF
IF
ERRORLEVEL
ERRORLEVEL
ERRORLEVEL
ERRORLEVEL
ERRORLEVEL
ERRORLEVEL
==1
==2
==3
==4
==5
==6
Set
Set
Set
Set
Set
Set
CubeName=ALL
CubeName=AcctASI
CubeName=AcctCON
CubeName=AcctFDN
CubeName=AcctGRP
CubeName=AcctLCE
Note that in this case, the choice provided for the user response corresponds to the label of
each option in the display section (X for All, A for AcctASI, C for AcctCON,
etc). These are controlled by the /C: paramater of the choice command (choice
/C:XACFGL).
Using the cls command at the beginning of the section will clear the CMD window and
provide a clean new display for the user. Again, this will allow the script to present only the
information that is necessary for the user to process.
If the user selects all cubes (option X), the script sets the VerifyQ variable to ALL. For all
other response, the VerifyQ variable will be set to a string containing the application and
database name (in this application, they are both the same. This is done in the following line
of code:
Verifying Action
After all the information is collected from the user, it is a good idea to ask the user to verify
the information collected before proceeding to the MaxL script. Using the echo command,
display the options the user selected up to this point:
:Verify
cls
echo *************************************
echo ***** TopDown ASO Data Utility ******
echo *************************************
echo.
echo Are you sure you want to clear and load data to:
echo.
echo Data Type: ... %DataType%
echo.
echo Applicaiton.Cube: ... %VerifyQ%
echo.
echo Year: ... %YearName%
echo.
echo MTD Rule Name:... ^%MTDRule%
echo.
This will look like this if the user selected the AcctCON cube:
This is how it will look if the user selected the All Cubes option:
The following section of the code asks the use to accept and continue entering Y, or reject
and abort by entering N.
CHOICE /M "-->> Enter Y to continue, or N to abort: "
if ERRORLEVEL==2 goto END
In this example, the log files are stored in the Logs folder, and the MaxL scripts are stored
in the Scripts folder. The first step is to change the working directory to the Logs folder:
D:
CD\Hyperion\Scripts\Logs
If the user selected to load data to all cubes, the script will jump to the LoadAll section of the
code. If not, it will continue to the next line of code:
IF %VerifyQ%==ALL GoTo LoadAll
Before calling the MaxL scripts, delete the log files for the cube that is being modified. This
is done by the following command:
Del Data_Utility~%CubeName%~%DataType%*.*
At this point, the script calls the MaxL script that executes the operations in Essbase. To do
this, the working directory must be set to the folder that contains the MaxL script:
CD\Hyperion\Scripts\Scripts
Now the MaxL script Data_Utility.mxl can be called. This MaxL script uses the CubeName,
DataType, YearName and MTDRule variables. These variables were set using information
provided by the user as described in the above sections:
The GoTo END line skips the section of the code that loads data to all cubes (covered in the
following section.
As noted above, if the user elects to load data to all cubes, the MaxL script is called for each
cube. Each time the MaxL script is called, the variable for the cube name is modified. This
way, there is no need to maintain multiple scripts for each operation. This is how it is done:
%YearName%
%YearName%
%YearName%
%YearName%
%YearName%
%MTDRule%
%MTDRule%
%MTDRule%
%MTDRule%
%MTDRule%
Note that the cube name is hardcoded each time the MaxL script is called instead of using the
CubeName variable.
The advantage of using the batch file to collect information from the user about the operation
to be performed is that the single batch file can call a single MaxL script. This makes it easier
for the administrator to maintain.
The first section of the MaxL script deals with setting the variables in the file. In this
example, all variables start with a lower case v. Some of the variables in the file are passed
on by the batch file:
/************Set Variables*******************/
Set vCube = $1;
Set vDataType = $2;
Set vMTDRule = $3;
Set vYearName = $4;
Other variables are hard coded into the MaxL Script:
Set vDataFolder = D:\\Hyperion\\AARPHyperion\\Data\\;
Set vLogFolder = D:\\Hyperion\\AARPHyperion\\AARP_Scripts\\Logs\\;
After the variables are set, turn on spooling to and send it to the log file. Note that the log file
is named by the vCube variable, which is passed on by the batch file:
Before starting any operation in Essbase, the script must login to the environment. This login
information can be encrypted using the MaxL encryption feature. In this example, no
encryption is used:
/****************Login**************************/
login "Admin" "Password123" on '10.158.128.72:1423';
After login, the script clears the section of the data provided by the users responses to in the
batch file:
After clearing the section of the cube, the data loading starts. In this example, there is a
separate data file for current and prior year. The file names are constant and therefore they are
hardcoded into the MaxL script. These filenames could be set as variables that are provided
by the user just like the cube name and the data type.
/************ Load data ***************/
echo
***************************************************************************
**;
Data_Utility.bat
@echo off
cls
D:
rem **** Set Time Stamp *****
set DateStamp=%DATE:~4,2%%DATE:~7,2%%DATE:~10,4%
set TimeStamp=%TIME:~0,2%%TIME:~3,2%
set DateAndTime=%DateStamp%~%TimeStamp%
echo *************************************
echo ***** TopDown ASO Data Utility ******
echo *************************************
echo.
echo Please select the data you want to load:
echo.
echo A. Actuals
echo.
echo B. Budget
echo.
echo F. Forecast
echo.
choice /C:ABF /M "-->> Enter a letter for the data you want to clear and
load: "%1
IF ERRORLEVEL==3 GOTO IsForecast
IF ERRORLEVEL==2 GOTO IsBudget
IF ERRORLEVEL==1 GOTO IsActual
:IsActual
Set DataType=Actual
Set MTDRule=FY_MTD
Set YTDRule=FY_YTD
GoTo CubeSeclection
:IsBudget
Set DataType=Budget
Set MTDRule=FY_MTDB
Set YTDRule=FY_YTDB
GoTo CubeSeclection
:IsForecast
Set DataType=F1
Set MTDRule=FY_MTDF
Set YTDRule=FY_YTDF
GoTo CubeSeclection
:CubeSeclection
cls
echo.
echo Please select a cube:
echo.
echo X. ALL
echo.
echo A. AcctASI
echo.
echo C. AcctCON
echo.
echo F. AcctFDN
echo.
echo G. AcctGRP
echo.
echo L. AcctLCE
echo.
choice /C:XACFGL /M "-->> Enter a letter for the cube you want to load: "%2
IF ERRORLEVEL ==1 Set CubeName=ALL
IF ERRORLEVEL ==2 Set CubeName=AcctASI
IF ERRORLEVEL ==3 Set CubeName=AcctCON
IF ERRORLEVEL ==4 Set CubeName=AcctFDN
IF ERRORLEVEL ==5 Set CubeName=AcctGRP
IF ERRORLEVEL ==6 Set CubeName=AcctLCE
IF %CubeName%==ALL (set VerifyQ=ALL) ELSE (Set VerifyQ=%CubeName%.%CubeName
%)
:CubeSeclection
cls
echo.
echo Please select a Year:
echo.
echo.
echo C. Current Year
echo.
echo P. Prior Year
echo.
echo B. Both
echo.
choice /C:CPB /M "-->> Enter a letter for the year you want to load: "%3
IF ERRORLEVEL ==1 Set YearName=CurYear
IF ERRORLEVEL ==2 Set YearName=PriorYear
IF ERRORLEVEL ==3 Set YearName=Both
:Verify
cls
echo *************************************
echo ***** TopDown ASO Data Utility ******
echo *************************************
echo.
echo Are you sure you want to clear and load data to:
echo.
echo Data Type: .......... %DataType%
echo.
echo Applicaiton.Cube: ... %VerifyQ%
echo.
Data_Utility.mxl
/************Set Variables*******************/
Set vCube = $1;
Set vDataType = $2;
Set vMTDRule = $3;
Set vYearName = $4;
Set vDataFolder = D:\\Hyperion\\AARPHyperion\\Data\\;
Set vLogFolder = D:\\Hyperion\\AARPHyperion\\AARP_Scripts\\Logs\\;
/************Turn spooling on*******************/
echo
***************************************************************************
**;
echo ****** Load "$vYearName" "$vDataType" data to "$vCube" using "^$vMTDRule"
Rule File ******;
Set vErrFileName = "$vLogFolder\Data_Utility~$vCube~$vDataType~$vYearName.err";
goto "$vYearName";
define label 'CurYear';
Set vDataFileName = "$vDataFolder\ABF_GL2HYPERION.csv";
goto 'ShowDataFileName';
define label 'PriorYear';
Set vDataFileName = "$vDataFolder\ABF_GL2HYPERION$vYearName.csv";
define label 'ShowDataFileName';
echo Data File Name: "$vDataFileName";
echo Error File Name: "$vErrFileName";
import database "$vCube"."$vCube" data from local text data_file "$vDataFileName" using
server rules_file "^$vMTDRule" on error write to "$vErrFileName";
echo
***************************************************************************
**;
echo ****** Load complete ******;
echo ;
/****************Logout and Exit**************/
logout;
exit;
spool off;
Oracles Calculation Manager has a host of features for creating business rules across the
Hyperion suite of products. Today I want to focus on how to automate those rules in a
Hyperion Planning environment. If you have Calculation Manager rules that you would like
to schedule to run on a periodic basis, including rules with run-time prompts, this post is for
you.
Step 1: Create an encrypted password file
The automation utilities for Planning include the ability to create an encrypted password file.
This is a recommended step in the process of automating rules.
On the Planning server go to the utilities directory (on my development environment this is
located at E:\Oracle\Middleware\user_projects\PLANNING0\Planning\planning1)
Open a command prompt and navigate to that directory. Run the PasswordEncryption.cmd
utility providing a filename and path for the encrypted file output:
It will prompt you for the password to encrypt. Once you type it in, it will generate the
password file password.txt in the directory specified.
Step 2: Create the Runtime Prompts file
Select the rule you want to automate from the business rules section of Planning. My example
rule is called Rollup and has a prompt for an Entity in the rule when a user runs it from a
web form. I would like to have the same rule run nightly and have it run for Total Entity.
Select Total Entity in the prompt box and then click on the Create runtime prompt values
file button.
This will create a file with the name of the rule (in my example Rollup.xml) on the Planning
server that contains the runtime prompt values specified. On my development server its here
(E:\Oracle\Middleware\user_projects\PLANNING0\Planning\planning\RTP\admin):
If you open the file in notepad youll see that its not actually an xml file, just plain text with
the values supplied. My rule contains Personal Preference variables in addition to the run
time prompts and they are also spelled out in the XML file.
You could create this file yourself from scratch following the syntax used in this example.
Step 3: Launch the rule using the /validate parameter to make sure you are
doing it right using the Command Line!
Where
f specifies the name of the password file we created in step 1.
/A is the name of the application.
/U is the username that the password corresponds to.
/D is the name of the database.
/R is the name of the rule
/F is the name and location of the runtime prompts values file we created in Step 2.
You should see it parse the variables and just return to the command prompt.
If everything looks good, remove the /validate parameter and run it. You can now wrap this
up in a batch file and schedule it to run as needed using your operating systems utilities. If in
the future the password changes for the user that you are using to run this you will need to rerun the Password Encryption utility to create a new password file.
A simple batch file to run this would look like this:
In a windows environment you could then use the Task Scheduler to call this batch file on a
frequency of your choice.
1)
2)
The purpose of the second option which is the EPM Clone Utility would be to
export and import all applications and data for an EPM instance for the purpose
of moving it to another system (aka. cloning).
1.
We would have noticed that during the LCM Export Migration Process, two files
on any artifact being exported are generated; an export.xml file and a
corresponding import.xml (see screenshot below).
For a detail definition on how to define these XML files has been documented in
the Lifecycle Management Guide. The easiest way would be is to create these
definitions files manually by exporting the artifacts that needs to be
systematically exported or archived using LCM.
In this example, we would be exporting all planning artifacts for the application
PubSect and the following artifact file definition has been created
lcm_pubsect_07052013.
The exported artifact also contain export definition file. You can also set this in
archive folder.
Use this definition file to automate the LCM Export using the command line
utility.bat located in the following location
C:\Oracle\Middleware\user_projects\epmsystem1\bin\
Note: The first time the utility file is execute, the export file prompts for
username and password. After the completion of the first execution, the export
file automatically stores the username and encrypted password.
Create a basic task using the Windows Task Scheduler (Control Panel -> Task
Scheduler)
Similar to the utility.bat file, there is a new utility to export all artifacts from one
server to another. This can be used as an alternative to clone an existing
environment.
1)
2)
Note:
You must copy the cloned export content in the EPMExportAll folder from the
source environment to the target environment in the same File System folder
location.
Syntax:
epm_cloneexport.bat input.properties
epm_cloneimport.bat input.properties
Purpose
This tutorial covers how to use the Performance Management Architect Batch Client to create
and deploy Oracle Hyperion Planning, Fusion Edition 11.1.2 applications.
Time to Complete
Approximately 1 hour.
Overview
Performance Management Architect Batch Client enables you to combine processes such as
data export, metadata loads, data loads, and calculations and run these operations during your
normal nightly or weekly load process. You can use the Batch Client to perform many tasks,
including the following:
You can run the Performance Management Architect Batch Client in two modes:
In this tutorial, you perform the steps to create and deploy Planning 11.1.2 applications using
the Batch Client in command line mode. After you deploy the application, you access it in
Application Library.
Optional: Oracle Hyperion Smart View for Office, Fusion Edition Release
11.1.2
Optional: Oracle Data Integrator, Oracle Data Profiling, and Oracle Data
Quality for Data Integrator 10g (10.1.3.5.0)
The batch client is installed automatically when you install Performance Management
Architect. You can run Batch Client on Windows platforms. When you install Performance
Management Architect, a batch file is automatically created to setup the class paths that are
generated during installation.
Prerequisites
Before starting this tutorial, you should:
1 . Have administrator access to a working installation of Planning 11.1.2.
To download documentation:
1 . Launch your browser.
2 . Navigate to the Oracle Enterprise Performance Management System, Fusion Edition Release
11.1.2 Documentation Library by using the following URL:
http://download.oracle.com/docs/cd/E17236_01/index.htm
4 . Under Oracle Hyperion Enterprise Performance Management Architect, Fusion Edition, for
Batch Client User's Guide, right-click PDF and select Save Link As....
5 . Navigate to the location where you want to save the file, and click Save.
2 . Enter your Performance Management Architect username and password with the following
syntax, and press Enter:
login username,password;
The following message is displayed: The application "PlanBud" has been created with
objectid "1_4".
You can create dimensions and members in Shared Library or within an application.
You can add dimensions and members to the Shared Library, or you can copy them from the
Shared Library to an application. You can add dimensions as shared dimensions or you can
copy them to the application as local dimensions. You can insert a copy of a member as a
shared member in an application. However, you can use the Insert Member command only on
local dimensions and Shared Library dimensions. You cannot insert members in a shared
dimension in an application.
You can also import dimensions and members to an application or Shared Library using an
ADS file.
This section covers the different methods of adding dimensions and members by using Batch
Client:
1 . Create dimensions with the following syntax and press Enter:
Create Dimension Properties(ApplicationName, DimensionName, DimensionDescription,
DimensionType) Values(#Shared,'Entity','Entity Dimension','Entity');
Note: Planning requires six dimensions. If these six dimensions are already created in Dimension
Library, you can add them to the application instead.
MemberNameA valid name for the new member. In this example, 'Income
Statement' is used.
3 . Import dimensions and members by using an ADS file with the following syntax, and press
Enter:
Execute Import Parameters(importtype, profilename, filename,
waitforcompletion)Values('flatfile', 'PlanApp', '.\AppFiles\PlanApp.ads', 'true');
FileNameThe name of the flat file to import, if performing a flat file type
import. In this example, the 'PlanApp.ads' flat file in the AppFiles directory is
used.
WaitForCompletionIf set to true, Batch Client waits for the job to finish. If
set to false, the Batch Client submits the job and continues. Allowed values
are: True or False.
4 . Use the following syntax to copy dimensions within Shared Library, within an application, or
between Shared Library and an application, and press Enter:
Copy Dimension Properties(ApplicationName, DimensionName, TargetDimensionName,
TargetDimensionDescription, destApplicationName) Values('#Shared', 'Scenario','Scenario',
'Scenario Dimension', 'PlanBud');
Note: You cannot copy a dimension directly from one application to another.
5 . Use the following syntax to add an existing dimension from the Shared Library to the specified
application, and press Enter after each line item:
SET APPLICATION = 'PlanBud';
Include Dimension Properties(DimensionName, IncludeAsShared) Values('C_Alias', 'true');
The dimension can be added as a shared dimension or copied to the application as a local
dimension.
Note: You must set the application name before the Include Dimension command. By setting the
application name, command lines use it if the application is not explicitly defined within a
command.
6 . Use the following syntax to insert a copy of a member as a shared member within an application,
and press Enter after each line item:
SET APPLICATION = 'PlanBud';
Insert Member Properties(DimensionName, ParentName, InsertMemberName,
MemberToInsertName) Values('Account', 'Par1', Mem1, Mem2);
You can use the Insert Member command only on local dimensions and Shared Library
dimensions. You cannot insert members in a shared dimension within an application.
Note: You must set the application name before the In command. By setting the application
name, command lines use it if the application is not explicitly defined within a command.
Alternatively, you can set the application name to #Shared if you are copying a member from
Shared Library.
WaitForCompletionIf set to true, Batch Client waits for the job to finish. If
set to false, Batch Client submits the job and continues. Allowed values are:
True or False
For additional Planning parameters, see the Oracle Hyperion Enterprise Performance
Management Architect, Fusion Edition 11.1.2 Batch Client's User Guide.
When the deployment is completed, the following message is displayed:
3 . Click the Planning application that you deployed in Batch Client. In this example, 'PlanBud' is
selected.
When you select an application, the following information is displayed in the lower pane:
SummaryContains the name, type, date created, date last deployed, and
the associated data synchronizations.
Rules / Rule SetEnumerates the rules and rule sets defined in Calculation
Manager for this application.