Banner Home Previous Next Index Help



Performing Interactive and Batch Operations Using ESSCMD


The Hyperion Essbase OLAP Server includes ESSCMD, a command-line interface that performs operations interactively or through a batch or script file.

This chapter describes how to use ESSCMD's interactive and batch processing modes, and provides sample script and batch files. It includes the following topics:

Note:   The Hyperion Essbase OLAP Server also includes MaxL, the multi-dimensional database access language for Hyperion Essbase. Using MaxL, you make requests to Hyperion Essbase using statements, rather than commands. MaxL comes with a Perl module that enables you to embed statements in Perl programs.

For MaxL and ESSCMD syntax and usage information, see the online Technical Reference in the DOCS directory.


Go to top ESSCMD Basics

With ESSCMD, you can execute server operations at the command line, in either interactive or batch mode.

Interactive mode means entering commands at the ESSCMD command line, and receiving prompts where necessary. Interactive mode is convenient for short operations that require few commands, checking for information on the fly, and error checking.

Batch processing mode is used for automating routine server maintenance and diagnostic tasks. You can write a script or batch file and run it from the command line. Batch processing mode is convenient if you frequently use a particular series of commands, or if a task requires many commands.


Go to top Syntax Guidelines

In general, use the same syntax for entering ESSCMD commands as you do for other Hyperion Essbase commands. However, there are differences between ESSCMD's interactive and batch processing modes in the requirements for quotation marks and the semicolon statement terminator. Use the guidelines in this section when creating script or batch files.

Quotation Marks

Quotation marks ("") enclose character parameters and responses to commands.

Semicolon Statement Terminator

The ; (semicolon) statement terminator signals the end of a command. For example:

SELECT "SAMPLE" "BASIC"; 

The SETAPPSTATE and SETDBSTATE commands, defined in the online Technical Reference in the DOCS directory, are examples of commands which you should terminate with a semicolon to prevent any confusion in processing.

Note:   All syntax examples in this chapter use quotation marks and semicolon terminators.

Go to top Running ESSCMD on Different Operating System Platforms

ESSCMD operates independently of any other Hyperion Essbase client interface, including the Application Manager, Spreadsheet Add-in, or custom-built application programs.

ESSCMD is available on the following platforms:

Canceling ESSCMD Operations

When running ESSCMD, you can cancel an asynchronous operation, such as a calculation, export, or restructure operation, by pressing and holding the Esc key until ESSCMD responds.


Go to top Referencing Files

Some commands require that you precede object or file names with a numeric parameter, from 1 to 4, that tells Hyperion Essbase where to look for the object or file. The parameter directs ESSCMD to look for files in other applications, databases, or systems.

The following table lists each value for the numeric parameter (numeric), the file location to which it applies, and the information that ESSCMD requests when you use each parameter setting. appName is the application name and dbName is the database name.

numeric File Hyperion Essbase prompts user for:
1 Local or client-based file Windows:
Files in the \ESSBASE\CLIENT\appName\dbName directory

UNIX:
Files in the essbase/client/appName/dbName directory
2 Remote or server-based file Windows:
Files in the \ESSBASE\APP\appName\dbName directory UNIX:
Files in the essbase/app/appName/dbName directory
3 File Fully-qualified path to the file, unless file is in the current ESSCMD directory
4 SQL table Full network and database information for the SQL table

For example, the LOADDATA command can load a data file that resides on the client or the Hyperion Essbase server. The command requires the numeric parameter to tell Hyperion Essbase where to look for the data file. This example causes ESSCMD to prompt for the fully-qualified path name of the file to load:

LOADDATA 3

File extensions are usually optional in both interactive and batch processing modes, except when using commands that require a numeric parameter that indicates the location of files:


Go to top Multi-User Considerations

Because ESSCMD supports multiple login instances on a Hyperion Essbase server, you can access more than one database in a single session. Even when you log in to multiple databases, you use only one port on your server license.


Go to top Case-Sensitivity

Case-sensitivity varies by operating system:


Go to top Getting Help

To display a list of all currently available ESSCMD commands, enter HELP ?. To see documented descriptions and syntax for individual ESSCMD commands, see the online Technical Reference, located in the ESSBASE/DOCS directory.


Go to top Quick Start to ESSCMD

Before you start ESSCMD, make sure that the following items are properly installed and running:

For information on protocols supported by Hyperion Essbase, see the Hyperion Essbase Installation Guide.


Go to top Starting and Quitting ESSCMD

The Hyperion Essbase server installation places the ESSCMD.EXE and ESSCMD.HLP files (ESSCMD and esscmd.hlp on UNIX platforms) in the BIN directory of your application server.

Once you start the application, a command prompt like this one displays:

:::[n]->

where n is the value of the active login instance. Each subsequent, successful login increments this value by one. When you start ESSCMD, the instance number is zero (0).

Note:   Use the SETLOGIN command to toggle between active login instances. Use the LISTLOGINS command to view active login instances. For more information, see the online Technical Reference, located in the ESSBASE/DOCS directory.

To start ESSCMD:

Do one of the following:

To quit ESSCMD:

Enter EXIT at the prompt and press Enter.

ESSCMD disconnects from the application server, and terminates the session.


Go to top Using Interactive Mode

In interactive mode, you enter commands and respond to prompts. This is useful when you are performing simple tasks that require few commands. If you are performing more complex tasks that require many commands, consider creating a script file or batch file; see Using Script and Batch Files for Batch Processing for information.

For syntax conventions when working in interactive mode, see Syntax Guidelines.


Go to top Logging Into the Server

After starting ESSCMD, you must connect to the Hyperion Essbase server so that you can enter commands. Follow these steps:

  1. At the ESSCMD prompt, log in to the server with the LOGIN command. For more information about this command, see the online Technical Reference, located in the ESSBASE/DOCS directory.
  2. Enter the Hyperion Essbase server name. When you connect from the server console, the server name depends on your network setup. For example, the name could be aspen.
  3. Enter your user name.
  4. Enter your password.

    The ESSCMD prompt is displayed as follows:

    aspen:::userName[1]->
    

    where userName is your login name.

    You can enter any valid ESSCMD command. For a complete listing of commands, type HELP.

    Note:   To load an application into memory and select a database on the Hyperion Essbase server, use the SELECT command to select a database from an application that resides on the server. For more information, see the online Technical Reference, located in the ESSBASE/DOCS directory.

    The ESSCMD prompt is displayed as follows:

    aspen:appName:dbName:userName[1]->
    

    where:


Go to top Entering Commands

There are two ways to enter commands in interactive mode. Choose either of the following methods to enter commands:

Whichever method you use, the interactive prompt now reflects the application and database names. For example, the following prompt tells you that the Sample application and Basic database are selected:

aspen:Sample:Basic:User[1]->

In this case, you can enter other commands without the application or database name parameters that it normally requires.


Go to top Canceling Operations

While ESSCMD is running, you can cancel an asynchronous operation, such as a calculation, export, or restructure operation, by pressing and holding the Esc key until ESSCMD responds.

CAUTION: Do not pause or suspend your system while Hyperion Essbase is processing a command. Pausing the system may prevent Hyperion Essbase from correctly completing the command.


Go to top Using Script and Batch Files for Batch Processing

If you use a series of commands frequently or you must enter many commands to complete a task, consider automating the task with a script or batch file. These files are useful for batch data loads and complex calculations.

For syntax conventions when working in batch processing mode, see Syntax Guidelines.

Note:   On UNIX, a batch or script file is written as a shell script. A shell script usually has the file extension.sh (Bourne or Korn shell) or.csh (C shell).

When you run a script or batch file, ESSCMD executes the commands in order until it reaches the end of the file.

Existing script or batch files might be affected by changes to some commands. To ensure that your files work in Hyperion Essbase 6, check on your use of changed or deleted commands. See the Hyperion Essbase Start Here booklet for information about new and changed commands.


Go to top Writing Script Files

ESSCMD script files automate an often-used or lengthy series of commands. Each script file must be a complete ESSCMD session, with login, application and database selection, logout, and termination commands.

To define a script file:
  1. Enter ESSCMD commands in any editor that saves data in ASCII text.
  2. Save the file with the.SCR ESSCMD script file extension.

    For example, the following script file, TEST.SCR, was created in Notepad:

    LOGIN "localhost" "User1" "password";   
    SELECT "Sample" "Basic";
    GETDBSTATE
    EXIT;

When run from the operating system command line, this script logs User1 into the Hyperion Essbase localhost server, selects the Sample application and Basic database, gets database statistics, and quits the ESSCMD session.


Go to top Running Script Files

To Run Script Files in ESSCMD

Enter the following command at the operating system prompt:

ESSCMD scriptFileName.SCR

Replace scriptFileName with the name of the script file. For example, type the following if the script file is in the current directory:

ESSCMD TEST.SCR

If the script file is in another directory, include the path. For example:

ESSCMD C:\WORK\SCRIPTS\TEST.SCR (an absolute path on Windows NT)

or

ESSCMD..\SCRIPTS\TEST.SCR (a relative path on Windows NT)


Go to top Handling Command Errors in a Script File

ESSCMD's error-handling features provide error checking and handling for your script files. You can write error-handling commands into your script file to check for errors and, if necessary, branch to an appropriate error-handling response.

After each ESSCMD command is executed, a number is stored in an internal buffer. If the command executes successfully, 0 is returned to the buffer; If the command is unsuccessful, the error number is stored in the buffer; this is called non-zero status.

For error checking within an ESSCMD script file, ESSCMD provides the following error-handling commands:

In this LOAD.SCR example file, if the LOADDATA command does not execute successfully, ESSCMD branches to the end of the file to avoid attempting to calculate and run a report script on the empty database.

LOGIN "localhost" "User1" "password" "Sample" "Basic";   
LOADDATA 2 "calcdat";
IFERROR "Error";
CALC "Calc All;";
IFERROR "Error";
RUNREPT 2 "Myreport";
IFERROR "Error";
[possible other commands]
EXIT;

:Error

EXIT;

Note:   You can use the OUTPUT command to log errors to a text file.

For the syntax and usage of ESSCMD error commands, see the online Technical Reference, located in the ESSBASE/DOCS directory.


Go to top Sample Script Files

The following script files demonstrate common Hyperion Essbase batch operations. All samples are based on the Sample Basic database that comes with your Hyperion Essbase program. The scripts for these examples are available in your \ESSBASE\APP\SAMPLE\BASIC directory. On UNIX systems, the examples are available from /home/hyperion/essbase/app/Sample/Basic.

Sample Script: Importing and Calculating Data

Suppose you need a file that executes the following actions:

The following script file does the job:

LOGIN "Poplar" "TomT" "Password";
SELECT "Sample" "Basic";
DISABLELOGIN;
IMPORT 2 "ACTUALS" 4 "Y" 2 "ACTUAL" "N";   
CALCDEFAULT;
ENABLELOGIN;
EXIT;

On Windows, this script file, SAMPLE1.SCR, is available in the \ESSBASE\APP\SAMPLE\BASIC directory. On UNIX platforms, SAMPLE1.SCR is in the /essbase/app/Sample/Basic directory.

Sample Script: Building Dimensions and Importing/Calculating Data from a SQL Source

Suppose you need a script file that executes the following actions:

The following script file does the job:

LOGIN "Poplar" "TomT" "Password";
SELECT "Sample" "Basic";
DISABLELOGIN;
BUILDDIM 2 "PRODRUL" 4 "PRODTBL" 4 "PROD.ERR";   
IMPORT 4 "TOMT" "PASSWORD" 2 "ACTUAL" "N";
CALCDEFAULT;
EXIT;

On Windows, this script file, SAMPLE2.SCR, is available in the \ESSBASE\APP\SAMPLE\BASIC directory. On UNIX systems, SAMPLE2.SCR is in the /essbase/app/Sample/Basic directory.

Sample Script: Scheduling Report Printing

Suppose you need a file that executes the following actions:

The following script file does the job:

LOGIN "Poplar" "TomT" "Password";   
SELECT "Sample" "Basic";
RUNREPT 2 "REP1" "REP1.OUT";
RUNREPT 2 "REP2" "REP2.OUT";
RUNREPT 2 "REP3" "REP3.OUT";
EXIT;

On Windows, this script file, SAMPLE3.SCR, is available in the \ESSBASE\APP\SAMPLE\BASIC directory. On UNIX platforms, SAMPLE3.SCR is in the /essbase/app/Sample/Basic directory.


Go to top Writing Batch Files

You can write a batch file that runs one or more ESSCMD scripts, and includes operating system commands. See your operating system instructions to learn the syntax for writing batch files.

For an example of a batch file, see Handling Command Errors in a Script File.


Go to top Handling Command Errors in Batch Files

For the operating system batch file, you can use ESSCMD command return values to control the flow of scripts that the batch file executes.

An ESSCMD program returns an integer value upon exiting. This value represents the status of the last executed command, usually whether the command succeeded or failed. You can set up your batch file to test for this value, and if the test fails, branch to an error-handling response. This process is similar to creating a script file. For information about handling errors in script files, see Handling Command Errors in a Script File.

For example, a batch file could contain three scripts: an ESSCMD batch file that loads data, a calc script that performs calculations on the data, and a report script that reports on the results of the calculation. If the load batch file fails, the calculations and reporting also fail. In this case, it would be best to stop the batch file after the failure of the load file and correct the error that caused the failure before going on. If your batch file tests for the return value of the load process, and this return value indicates failure, the batch file can jump to the end of the file and stop or execute some other error-handling procedure, rather than attempting to calculate data that did not load.

The following example shows an NT operating system batch file and the contents of one of the ESSCMD scripts it runs, LOAD.SCR. Because error-checking requirements vary, the syntax in this example may not correspond to that of your operating system. See your operating system documentation for error checking in batch files.

An operating system batch file could contain commands like this:

ESSCMD LOAD.SCR
If not %errorlevel%==goto Error
ESSCMD CALC.SCR
If not %errorlevel%==goto Error
ESSCMD REPORT.SCR
If not %errorlevel%==goto Error
Echo All operations completed successfully
EXIT


:Error
Echo There was a problem running the script   


Home Previous Next Index Help Banner


Copyright © 1991-2000 Hyperion Solutions Corporation. All rights reserved.