In this blog, I would be talking about the first line in any
Essbase calculation script. Actually, this came up this morning when I was
trying to run a calculation script and it gave a weird error. This is shown in
the below snapshot:-
The error says that “The calculation script contains a bad
or malformed locale header. Your script cannot be run.”
Now the first line in the script is usually //ESS_LOCALE*
which basically lists the error that we encountered. So I checked the
calculation script that I was running and this is shown in the below snippet.
If you observe, there is a tab that has split United States into
two pieces (talk about irony, the US general elections reflected in my Essbase
calculation script. Butterfly effect, I guess)
So I fixed this error by removing the tab. This
is shown in the next snapshot.
Once I had fixed the tab and executed the calc script, it
ran perfectly as shown in the below snapshot.
So now the question, what is the ESS_LOCALE and why is the
encoding needed? Let us go back to a history lesson. Remember that Essbase calc
script engine is coded in Java and it supports Unicode application. The reason
for having Unicode applications is so that it can support applications in
languages other than English. More information about Unicode is present here(http://unicode.org/standard/WhatIsUnicode.html)
Unicode is basically needed so that I can have an
application in say Mandarin or Arabic. But now comes the best part. Remember
that the parser and calculation script run engine are all coded to be generic.
This is because the syntax does not change. Meaning Unicode application or
non-Unicode one, a calculation script would always run the same. That is
because we basically allow users to Model and View in a user-friendly format,
the internal controller treats everything as a string of 0s and 1s. But to make
sense of what exactly is needed by a script and which member to refer to, we
use the ESS_LOCALE. It basically tells what is the language that should be used
for understanding the semantics of the script and parse it accordingly.
By the way, the support for various languages (what we call
as Unicode applications) is technically called as Internationalization in Java.
Internationalization is “the process of
designing an application so that it can be adapted to various languages and
regions without engineering changes. Sometimes the term internationalization is
abbreviated as i18n, because there are 18 letters between the first
"i" and the last "n." “. More details on this is present at
this link (https://docs.oracle.com/javase/tutorial/i18n/intro/index.html
)
No comments:
Post a Comment