Update on usage of (quotes and back slashes)
Something crazy (or me being crazy) I learned.
Usage of quotes, backslashes in MaxL
We all know or learned that for Windows you’ve to use \ as an escape character for folder paths.
Try it with single quote and single slash (‘,) it’ll still work.
for e.g
spool on to ‘D:TempOutput.txt’ will work same as spool on to ‘D:\Temp\Output.txt’
However if you are someone like me who always use double quotes(“), so going by that rule on error write to “D:\Temp\Output.txt” and on error write to “D:TempOut put.txt” both works fine.
but do if you use ” with (single backslash) in an import statement it will not work!!!! (if you are using a
What I learned is if you are using ” then always use \ (on Windows)
Dynamic Maxl scripts using environment variables
I was creating some automation scripts in Essbase and found it quite tedious to change a bunch of Maxls and bat files when I move from DEV to QA and to Prod.
I made the bat files dynamic by adding local variables
REM # ———————————————————————————————————————-
REM # — Main directories & Application definition —
REM # ———————————————————————————————————————-
SET BASE_DIR=C:Cera_Hyperion_scripts
SET OUTBOUND_SERVER=CeraOutserver
SET ESSENV=Dev
But the issue was to make Maxl scripts dynamic, after lot of googling I stumbled upon Matt Milella’s blog.
I tried the same on 11.1.2 and however I couldn’t make that one work because I was invoking Maxl using essmsh not msh. So I took the essence of what was given there and added some local variables in my Bat script as follows.
REM # ———————————————————————————————————————-
REM # — Maxl definitions —
REM # ———————————————————————————————————————-
SET essUserName=essadmin
SET essPassword=esspassword
SET essServerName=ceraessbase
SET maxlBaseDir=C:\Cera_Hyperion_scripts
I changed my Maxl scripts to use these variables
/* login with username and password */
login $essUserName $essPassword on $essServerName;
iferror ‘Finish’;
/* Spool the results of this extract process to a log file */
spool on to $maxlBaseDir\logs\Data_Export.log;
set timestamp on;
iferror ‘Finish’;
Yes it is $maxlBaseDir (even I was skeptic $ and that too in windows, I tired %maxlBaseDir% and that one failed)
Then I called this maxl using essmsh login.msh in the bat file and it worked fine.
This will save lot of time when you are migrating between servers.
HTH
Hi Celvin,
How are you?…
I need to hide the password in logfile while running the batch script.
Please let me know how to hide the passwords?
Thanks
Radha
You can encrypt (https://orahyplabs.com/2010/05/how-to-encrypt-essbase-maxl-scripts.html) the password. Also you can start the spool after the login command.
That is pretty useful .. Thanks Buddy