MaxL-Skriptdateien mit @CalcMgrExecuteMaxLScript ausführen

Syntax für @CalcMgrExecuteMaxLScript:

RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLScriptFunction 
     <LOG FILE> OPTIONAL ex., "logfile=c:/Temp/maxlrule.log" The path should be accessible from the ESSBASE process
     <ASYNCH FLAG> OPTIONAL ex., "true"  This means calc engine will not wait for the completion of the maxl script.
        "mdx=true"OPTIONAL The variables are replaced with MDX syntax. This applies only to variables within the Crossjoin sections.
        "-D" if using encryption
        "<PRIVATE KEY>" if using encryption
         <SCRIPT LINE>
         <SCRIPT LINE>
         <SCRIPT LINE>
         ...
     <ALL OTHER PARAMETERS YOU PASS TO ESSMSH>
Beispiel 1: @CalcMgrExecuteMaxLScript
       RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLScriptFunction
       "-D"
       "28567271,1186612387"
       "spool on to 'C:\\ALC\\out.log'"
       "login $key 893848844082678214004255849650 $key 4647275840619320283077900267208176084380 on localhost"      
       "alter database 'SampleASO'.'Basic' clear data in region 'Crossjoin(Descendants([TotalPV],Province.Levels(0)),Crossjoin(Descendants([TotalLOB],LOB.Levels(0)),
        Crossjoin(Descendants([TotalActivity],Activity.Levels(0)),Crossjoin(Descendants([TotalBrand],Brand.Levels(0)),
        Crossjoin(Descendants([BS000],Account.Levels(0)),Crossjoin({[FY14]},Crossjoin({[Working]},Crossjoin({[Apr]},{[Actual]}))))))))' physical"
       "logout"        
       "spool off"     
       "exit"
 
Beispiel 2: Runtime Prompt-Variable und MaxL-Argumentträger

In diesem Beispiel ist das Skript nicht fest, sondern basiert auf einem Runtime Prompt oder einem MaxL-Argument. Wenn Sie einen Runtime Prompt in Text innerhalb von Anführungszeichen oder $1 innerhalb von Text in Anführungszeichen in MaxL verwenden, führt Oracle Hyperion Planning keine Ersetzung durch. Im folgenden Beispiel wird ein Runtime Prompt statt Hartcodierung von "Working" verwendet. Sie können das Skript mit einem Runtime Prompt und einem MaxL-Argumentträger neu schreiben.

RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLScriptFunction
       "-D"
       "28567271,1186612387"
       "spool on to 'C:\\ALC\\out.log'"
       "login $key 893848844082678214004255849650 $key 4647275840619320283077900267208176084380 on localhost"      
       "alter database 'SampleASO'.'Basic' clear data in region 'Crossjoin(Descendants([TotalPV],Province.Levels(0)),Crossjoin(Descendants([TotalLOB],LOB.Levels(0)),
         Crossjoin(Descendants([TotalActivity],Activity.Levels(0)),Crossjoin(Descendants([TotalBrand],Brand.Levels(0)),
         Crossjoin(Descendants([BS000],Account.Levels(0)),Crossjoin({[FY14]},Crossjoin({[$1]},Crossjoin({[Apr]},{[Actual]}))))))))' physical"
       "logout"        
       "spool off"     
       "exit"
    {WhatVersion}

In diesem Beispiel ist {WhatVersion} eine Runtime Prompt-Variable. In diesem Beispiel werden alle nach "exit" folgenden Werte als Argument für das Skript behandelt. Die benutzerdefinierte Funktion ersetzt $1, $2..$n im Skript anhand der Argumentanzahl.

Beispiel 3: MaxL=True
RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLScriptFunction   
......"mdx=true"
......"-D"
......"28567271,1186612387"
......"spool on to '/tmp/Essbase_ClearAndLoadStandardFX.log'"   
......"login $key 893848844082678214004255849650 $key 4647275840619320283077900267208176084380 on localhost"  
......"alter database glblaso.aso clear data in region '   CrossJoin( {$1} , { ( $2 , [Actual] , $3 , [USD]  )}  )'  physical "
......"import database 'GlblASO'.'ASO' data from server text data_file '../../StdFxExport.txt' using server rules_file 'LdASO' on 
......error write to './tmp/EssbaseLoadASOStdFX_errors.log' "
      "logout"        
      "spool off"     
      "exit"
      "LE_83901,LE_83911" 
      "Jan" 
      "2014"

Die Syntax in diesem Beispiel ergibt das folgende Skript:

spool on to '/tmp/Essbase_ClearAndLoadStandardFX.log';
      login $key 893848844082678214004255849650 $key 4647275840619320283077900267208176084380 on localhost;
      alter database glblaso.aso clear data in region ' CrossJoin([LE_83901], [LE_83911] , { ( [Jan] , [Actual] , [2014] , [USD]  )}              )'  physical ;
      import database 'GlblASO'.'ASO' data from server text data_file '../../StdFxExport.txt' using server rules_file 'LdASO' on 
      error write to './tmp/EssbaseLoadASOStdFX_errors.log' ;
      logout;
      spool off;
      exit;

Hinweis: MDX=true ist optional. Mit MDX=true werden die Variablen mit MDX-Syntax in den Crossjoin-Abschnitten ersetzt.

Beispiel 4: Liste mit Funktionen mit doppelten Anführungszeichen und Semikola

In diesem Beispiel soll die folgende Berechnung mit CDF ausgeführt werden:

RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLScriptFunction
     "spool on to 'c:/tmp/calc.log'"   
     "login admin password on localhost"  
     "execute calculation '
     SET CREATEBLOCKONEQ ON;
     SET AGGMISSG ON;
     FIX (@IDESCENDANTS("BS"),"Plan")
         DATACOPY "Working" to "Target";
     ENDFIX

     FIX ("Plan","Target")
         CALC DIM ("Account","Period","Entity","Product");
     ENDFIX'
     on Vision.Plan1"
     "logout"        
     "spool off"     
     "exit"
     ;

     OK/INFO - 1012553 - Copying data from [Working] to [Target] with fixed members [Account(1110, 1150, 1100, 1210, 1220, 1260, 1200, 1310, 1332, 1340, 1300, 
     1410, 1460, 1     471, 1400, 1010, 1510, 1520, 1530, 1540, 1550, 1560, 1565, 1570, 1580, 1500, 1610, 1620, 1630, 1640, 1650, ].
     OK/INFO - 1012675 - Commit Blocks Interval for the calculation is [3000].
     OK/INFO - 1012675 - Commit Blocks Interval for the calculation is [3000].
     OK/INFO - 1012574 - Datacopy command copied [0] source data blocks to [0] target data blocks.
     OK/INFO - 1012675 - Commit Blocks Interval for the calculation is [3000].
     OK/INFO - 1012714 - Regular member [Sales Calls] depends on dynamic-calc member [Rolling]..
     OK/INFO - 1012714 - Regular member [Sales Calls] depends on dynamic-calc member [YearTotal]..
     OK/INFO - 1012714 - Regular member [Period] depends on dynamic-calc member [YearTotal]..
     OK/INFO - 1012684 - Multiple bitmap mode calculator cache memory usage has a limit of [5] bitmaps..
     OK/INFO - 1012668 - Calculating [ Account(All members) Period(All members) Entity(All members) Product(All members)] 
     with fixed members [Scenario(Plan); Version(Target)].
     OK/INFO - 1012677 - Calculating in serial.
     OK/INFO - 1012550 - Total Calc Elapsed Time : [0.002] seconds.
     OK/INFO - 1013274 - Calculation executed.

     MAXL> logout;
     User admin is logged out
     MaxL Shell completed

Dieses Skript generiert das folgende Ergebnis:

essmsh C:\Users\SRMENON\AppData\Local\Temp\2\calc8153268024796650753.mxl 

     Essbase MaxL Shell 64-bit - Release 11.1.2 (ESB11.1.2.4.000B154)
     Copyright (c) 2000, 2014, Oracle and/or its affiliates.
     All rights reserved.

     MAXL> login admin password on localhost;
     ""
     OK/INFO - 1051034 - Logging in user [admin@Native Directory].
     OK/INFO - 1241001 - Logged in to Essbase.

     MAXL> execute calculation '
        2> SET CREATEBLOCKONEQ ON;
        3> SET AGGMISSG ON;
        4> FIX (@IDESCENDANTS("BS"),"Plan")
        5> DATACOPY "Working" to "Target";
        6> ENDFIX
        7> 
        8> FIX ("Plan","Target")
        9> CALC DIM ("Account","Period","Entity","Product");
       10> ENDFIX'
       11> on Vision.Plan1;

Oracle Essbase interpretiert die Zeichen " und ; in den Zeichenfolgen allerdings nicht korrekt. Ersetzen Sie zur Umgehung dieses Problems alle " durch &quot& und alle ; durch &scolon&:

RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLScriptFunction   
     "logfile=c:/Temp/maxl.log"
     "spool on to 'c:/tmp/calc.log'"   
     "login admin password on localhost"  
     "execute calculation '
     SET CREATEBLOCKONEQ ON&scolon&
     SET AGGMISSG ON&scolon&
     FIX (@IDESCENDANTS(&quot&BS&quot&),&quot&Plan&quot&)
         DATACOPY &quot&Working&quot& to $quot&Target&quot&&scolon&
     ENDFIX

     FIX (&quot&Plan&quot&,&quot&Target&quot&)
         CALC DIM (&quot&Account&quot&,&quot&Period&quot&,&quot&Entity&quot&,&quot&Product&quot&)&scolon&
     ENDFIX'
     on Vision.Plan1"
     "logout"        
     "spool off"     
     "exit"
     ;