ESSCMD To Maxl Conversion Utility


cmd2mxl is a fully supported utility for converting existing ESSCMD scripts to their corresponding MaxL scripts. To convert an ESSCMD script to a MaxL script, go to the operating-system command prompt and enter the executable name, the ESSCMD script name, the desired MaxL script name, and the name of a logfile to write to in case of errors.

Usage

cmd2mxl esscmd_script maxl_output logfile

For example, if the ESSCMD script name is %ARBORPATH%\dailyupd.scr, the command issued on the operating-system command line would be:

cmd2mxl %ARBORPATH%\dailyupd.scr %ARBORPATH%\dailyupd.mxl %ARBORPATH%\log\dailyupd.log

Subsequently, the MaxL script can be executed using the MaxL Shell by the follwing command:

essmsh %ARBORPATH%\dailyupd.mxl

Things to note

  1. The utility will only translate syntactically and semantically valid ESSCMD scripts.
  2. For invalid ESSCMD scripts, the resulting MaxL script is undefined.
  3. All ESSCMD statements in the scripts should end with a semicolon ( ; ) statement terminator.
  4. This utility will only work on Windows platforms.
  5. Although most ESSCMD commands have corresponding MaxL statements, there are exceptions. For such exceptions, a comment will be generated in the logfile, and the resulting MaxL script will have to be modified to work correctly. Note that if an ESSCMD command is still needed, it can be invoked from a MaxL script using shell esscmd <scriptname>.
  6. All strings in the ESSCMD scripts should be surrounded by double quotation marks ("").

ESSCMD to MaxL Mapping

The following table compares ESSCMD usage to MaxL usage, and the following conversions are supported by cmd2mxl.

ESSCMD command ESSCMD Usage Example MaxL Equivalent Example
ADDUSER ADDUSER finance essexer1; alter user essexer1 add to group finance;
BEGINARCHIVE beginarchive sample basic "test.txt"; alter database Sample.Basic begin archive to file 'test.txt';
BEGININCBUILDDIM beginincbuilddim; import database Sample.Basic dimensions from local text data_file 'c:\\data.txt' using local rules_file 'c:\\data_rule.rul' on error write to 'c:\\error.log';
BUILDDIM builddim 1 "c:\data_rul.rul" 3 "c:\data.txt" 4 "c:\error.log"; Same as BEGININCDIMBUILD
CALC calc "CALC ALL;"; execute calculation 'CALC ALL' on sample.basic;
CALCDEFAULT calcdefault; execute calculation default on Sample.Basic;
CALCLINE calcline "CALC ALL;"; execute calculation 'CALC ALL;' on sample.basic;
COPYAPP copyapp sample sampnew; create application sampnew as sample;
COPYDB copydb sample basic sample basic2; create or replace database sample.basic2 as sample.basic;
COPYFILTER copyfilter sample basic westwrite sample basic westmgr; create filter sample.basic.westmgr as sample.basic.westwrite;
CREATEAPP createapp finance; create or replace application finance;
CREATEDB createdb finance investor; create or replace database finance.investor;
CREATEGROUP creategroup managers; create group managers;
CREATELOCATION select sample basic;
createlocation hq hqserver finance investor admin password;
alter system load application sample;
alter application sample load database basic;
create location alias hq from sample.basic to finance.investor at hqserver as admin identified by 'password';
CREATEUSER createuser karen password; create user karen identified by 'password';
CREATEVARIABLE createvariable CurMnth localhost sample basic Jan; alter database sample.basic add variable CurMnth 'Jan';
alter application sample add variable CurMnth 'Jan';
alter system add variable CurMnth 'Jan';
DELETEAPP deleteapp sampnew; drop application sampnew cascade;
DELETEDB deletedb demo basic; drop database demo.basic;
DELETEGROUP deletegroup engg; drop group engg;
DELETELOCATION select finance investor;
deletelocation hq1;
alter system load application finance;
alter application finance load database investor;
drop location alias finance.investor.hq1;
DELETELOG deletelog sample; alter application sample clear logfile;
DELETEUSER deleteuser rob; drop user rob;
DELETEVARIABLE select sample basic;
deletevariable CurMnth "localhost";
alter system load application sample;
alter application sample load database basic;
alter database sample.basic drop variable CurMnth;
alter application sample drop variable CurMnth;
alter system drop variable CurMnth;
DISABLELOGIN disablelogin demo; alter application demo disable connects;
ENABLELOGIN enablelogin demo; alter application demo enable connects;
ENDARCHIVE endarchive sample basic; alter database sample.basic end archive;
ENDINCBUILDDIM ENDINCBUILDDIM; See BEGININCBUILDDIM
EXIT exit; exit;
EXPORT select sample basic;
export "c:\data.txt" 1;
alter system load application sample;
alter application sample load database basic;
export database Sample.Basic all data to data_file 'c:\\data.txt';
GETALLREPLCELLS select samppart company;
getallreplcells "svr2" "sampeast" "east";
alter system load application samppart;
alter application samppart load database company;
refresh replicated partition samppart.company from sampeast.east at svr2;
GETAPPSTATE getappstate demo; display application demo;
GETDBSTATE getdbstate sample basic; display database sample.basic;
GETUPDATEDREPLCELLS See GETALLREPLCELLS See GETALLREPLCELLS
GETUSERINFO getuserinfo admin; display user admin;
GETVERSION getversion; version;
IMPORT select sample basic;
import 1 "c:\data.txt" 4 y 3 "c:\import.rul" n "c:\data_load.err";
alter system load application sample;
alter application sample load database basic;
import database sample.basic data from local text data_file 'c:\\data.txt' using local rules_file 'c:\\data_rule.rul' on error write to 'c:\\data_load.err';
INCBUILDDIM See BEGININCBUILDDIM See BEGININCBUILDDIM
LISTAPP listapp; display application all;
LISTDB listdb; display database all;
LISTFILTERS listfilters sample basic; display filter on database Sample.Basic;
LISTGROUPS listgroups; display group all;
LISTGROUPUSERS listgroupusers finance; display user in group finance;
LISTLOCATIONS select sample basic;
listlocations;
alter system load application sample;
alter application sample load database basic;
display location alias on database sample.basic;
LISTLOGINS listlogins; display session all;
LISTUSERS listusers; display user all;
LISTVARIABLES listvariables localhost sample basic; display variable on database sample.basic;
LOADAPP loadapp sample; alter system load application sample;
LOADDB loaddb sample basic; alter application sample load database basic;
LOADDATA select sample basic;
loaddata 3 "c:\data.txt";
alter system load application sample;
alter application sample load database basic;
import database sample.basic data from local text data_file 'c:\\data.txt' on error abort;
LOGIN login local admin password; login admin 'password' on local;
LOGOUT logout; logout;
LOGOUTALLUSERS logoutallusers y; alter system logout session all;
LOGOUTUSER Available only in interactive ESSCMD sessions. alter system logout session 4294967295;
OUTPUT output 1 c:\test.log;
output 4;
spool on to 'c:\test.log';
spool off;
PUTALLREPLCELLS select sampeast east;
putallreplcells svr1 samppart company;
alter system load application sampeast;
alter application sampeast load database east;
refresh replicated partition sampeast.east from samppart.company at svr1 updated data;
PUTUPDATEDREPLCELLS See PUTALLREPLCELLS See PUTALLREPLCELLS
REMOVEUSER removeuser finance steve; alter user steve remove from group finance;
RENAMEAPP renameapp sample newsamp1; alter application sample rename to newsamp1;
RENAMEDB renamedb sample basic newbasic; alter database sample.basic rename to newbasic;
RENAMEFILTER renamefilter sample basic westmgr allwest; create or replace filter sample.basic.westmgr as sample.basic.allwest;
drop filter sample.basic.westmgr;
RENAMEUSER renameuser steve_m m_steve; alter user steve_m rename to m_steve;
RESETDB select sample basic;
resetdb;
alter database sample.basic reset;
RUNCALC The only command supported is the server based calc script execution.
Select Sample Basic;
Runcalc 2 one;
execute calculation Sample.Basic.one;
RUNREPT select sample basic; runrept 2 complex "c:\complex.out"; alter system load application sample;
alter application load database basic;
export database sample.basic using server report_file 'complex' to data_file 'c:\\complex.out';
SELECT select sample basic; alter system load application sample;
alter application load database basic;
SETAPPSTATE setappstate sample "" y y 4 y y y y 1000 1000; alter application sample enable startup;
alter application sample enable autostartup;
alter application sample set minimum permission designer;
alter application sample enable connects;
alter application sample enable commands;
alter application sample enable updates;
alter application sample enable security;
alter application sample set lock_timeout after 1000 seconds;
alter application sample set max_lro_file_size 1000 kb;
SETDBSTATE setdbstate "" "Y" "Y" 4 3145728 "Y" "Y" "Y" "" "" 0 1048576 1025 "Y"; alter database sample.basic enable startup;
alter database sample.basic enable autostartup;
alter database sample.basic set minimum permission designer;
alter database sample.basic set data_cache_size 3145728;
alter database sample.basic enable aggregate_missing;
alter database sample.basic enable two_pass_calc;
alter database sample.basic enable create_blocks;
alter database sample.basic set currency_conversion division;
alter database sample.basic set index_cache_size 1048576;
alter database sample.basic enable compression;
SETDBSTATEITEM

.

See the alter database statement in the MaxL Language Reference
SETDEFAULTCALCFILE select sample basic;
setdefaultcalcfile defcalc;
Create a calculation file in the server containing the calculation string. Then, alter database sample.sasic set default calculation sample.basic.defcalc; will set the default calculation.
SETMSGLEVEL setmsglevel 2; set message level all;
Note: this is part of the separate MaxL Shell grammar, not the MaxL language itself. You can use set message level with the MaxL Shell, but it is not embeddable in Perl.
SETPASSWORD setpassword steve newpass; alter user steve set password newpass;
SHUTDOWNSERVER shutdownserver local admin password; login admin 'password' on local;
alter system shutdown;
SLEEP sleep 10; shell sleep 10;
UNLOADAPP unloadapp sample; alter system unload application sample;
UNLOADDB unloaddb sample basic; alter application sample unload database basic;
UPDATEFILE updatefile 3 "c:\data.txt" 1; same as LOADDATA;
UPDATEVARIABLE updatevariable hot_product local sample basic "100-10"; alter system set variable 'hot_product' '100-10';
alter application sample set variable 'hot_product' "100-10";
alter database Sample.Basic set variable 'hot_product' '100-10';

Copyright 1991-2002 Hyperion Solutions Corporation. All rights reserved.