MAXL - read dynamically batch file

Hello

I'm on a client running Essbase 11.1.2 on Windows. I'm new to the part of the script. I'm writing a maxl script and the script of commands to move data from several systems in the environment. I wish I had maxl load files dynamically load since the name of the file may change from time to time. Need advice on how to do it.

Thank you
Matt

Hi Matt,

Both Maxl and Batch (.bat, .cmd) files accept input variables. In Maxl, if you run the myscript.mshscript:

essmsh myscript.msh myDataFile.txt myRulesFile.rul

inside the Maxl script, you can capture these two file passed in on it (myDataFile.txt myRulesFile.rul) name using the $1 and $2 variables. in this case $1 would receive the value myDataFile.txt, and $2 would be myRulesFile.rul

This is known as "passing in command line arguments.

You can do the same thing with the use of batch %1 %2 files...

Passing the files changing name of your batch file is a bit more complicated, you'll need to read the files from the file system to get new names and move to the MaxlScript:

CD C:\Folder\where\my\files\are
for /f %%d in (' dir/s/b / ad') call: runMaxl %.
Goto: eof

: runMaxl
essmsh myscript.msh %1

pause

Robb Salzmann

Tags: Business Intelligence

Similar Questions

  • MaxL Script and batch file

    I have a MaxL script that exports data from different cubes Level0. I have a batch file to call this script at daily intervals.

    I want to name something out of different every day (preferably NAMEmmdd type format). I know that I can add a rename or move the lot but wonder if there is a MaxL method that will allow me to export to another name?

    Current MaxL is simply
    export database APP. Level0 data_file DB database ' ' $Arborpath\am1119.txt "";

    Ideas or direction to go learn the answer?

    T,
    J

    Hello

    You can enter variables in maxl, so you the calling batch file can pass in a variable that contains the name of the file with the current date...

    For example, you have a batch file
    essmsh c:\temp\export.mxl "C:\temp\output%DATE:~3,2%%DATE:~0,2%.txt".

    If that was run today it would pass in ' C:\temp\output1118.txt

    Now in your maxl you just refer to the variable with

    export data from database sample.basic Level0 to data_file $1;

    $1 refers to the variable which has been adopted, the 1 being the position, in which it was adopted.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to kill the Batch files

    Hello

    I have three files batch for the aggregation.

    I used maxL in the batch file, and there are nearly 10 scripts of aggregation.

    Sometimes I have to kill the batch files... Can anyone please suggest how to kill the ball file while running.


    Thanks in advance.

    Depends on who do OS you run the script, you run the script and why you want to kill the script
    The script can be killed, but this does not mean that the current operation of essbase, you may need to use maxl /eas to try to kill the active session/query.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Passage of the maxl script batch file value.

    Hi gurus,

    I want the user to select the scenario he wants to clear the data for a specific intersection in a cube of ASO for running batch file. Files and newspapers is as below

    Batch file:

    ECHO please select a scenario:

    ECHO A. actuals

    B. Budget echo

    choice/m C:AB '-> > enter a letter for the scenario you want to delete: "%1 '"

    IF ERRORLEVEL is 1 Set ScenarioName = law

    IF ERRORLEVEL == 2 Set ScenarioName = bud

    E:\Oracle\Middleware\user_projects\epmsystem3\EssbaseServer\essbaseserver1\bin\startMaxl.bat "C:\Users\TCleardata2.mxl" % ScenarioName %

    MaxL file:

    spool to 'C:\Users\Cleardatalog.txt ';

    / * Value Variables * /.

    Set vScenarioName = $1;

    Echo script: "$vScenarioName";

    connection username pwd on "IP:1423 Server";

    / * Erase data * /.

    ALTER database abc.abc clear data in the region ' {("$1", Final, FY15, P2, ACC_1011640)}' physical;

    echo * clear full *;

    disconnection;

    spool off;

    Log file:

    Scenario: law

    MAXL > connection username pwd on "IP:1423 Server";

    OK/INFO - 1051034 - user [username@pqr] connection.

    OK/INFO - 1241001 - connected to Essbase.

    *****************************************************************************

    MAXL > alter database abc.abc clear data in the region ' {("$1", Final, FY15, P2, ACC_1011640)}' physical;

    ERROR - 1260052 - syntax error in a MDX query on line 1 to token entry ' "$1".

    *****************************************************************************

    Full Claire *.

    MAXL > disconnect;

    Username is disconnected

    ___________________________________________________________________________________-

    in the MAXL if I write: law instead of ' $1 ' it works fine, but I can't take the user input, it is question of syntax?

    Below the command works fine:
    ALTER database abc.abc clear data in the region '{(law, Final, FY15, P2, ACC_1011640)}' physical;

    Can someone please let me know what I'm doing wrong here?

    Thank you

    RN

    I don't think that (alone) allows in this case - the problem is that the single quotes around the specification of the whole region removes extension variable (see Variables).

    Double quotes lose about $1, but also replace the single quotes around the specification of the entire region with quotes, i.e.:

    ALTER database abc.abc clear data in the region '{($1, Final, FY15, ACC_1011640, P2)}' physical;

  • Batch file executes all commands, MaxL seems to stop their

    I have a batch file that looks like this (removed from the game in the middle which makes extraction of data, this is just to test)



    E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient-32\bin\startMaxl.cmd "E:\DataExtract\Scripts\MaxL-StartArchive.txt".


    E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient-32\bin\startMaxl.cmd "E:\DataExtract\Scripts\MaxL-StopArchive.txt".

    It runs the first discovery MaxL file, and then in the said command prompt "MaxL Shell" done and goes back to the command prompt. It is not picking up the second MaxL script.

    We are past just 11.1.2.1 and this has worked well in 11.1.1.3 when using essmsh. No idea why it is not in the script?

    The contents of the two files is:

    MaxL-StartArchive
    login 'admin' identified by 'removedpassword' on 'servername ';

    ALTER database CSHBud.PandL start archive to the file "E:\DataExtract\CurrentExtracts\Archive-CSHBud-PandL.txt";
    ALTER database CSHBud.Wrkforce start archive to the file "E:\DataExtract\CurrentExtracts\Archive-CSHBud-Wrkforce.txt";

    ALTER database PropBud.NOIStmt start archive to the file "E:\DataExtract\CurrentExtracts\Archive-PropBud-NOIStmt.txt";
    ALTER database PropBud.Staffing start archive to the file "E:\DataExtract\CurrentExtracts\Archive-PropBud-Staffing.txt";

    disconnection;

    MaxL-StopArchive
    login 'admin' identified by 'removedpassword' on 'servername ';

    Edit the Archives of end CSHBud.PandL of database;
    Edit the Archives of end CSHBud.Wrkforce of database;

    Edit the Archives of end PropBud.NOIStmt of database;
    Edit the Archives of end PropBud.Staffing of database;

    disconnection;
    "exit";

    >

    E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient-32\bin\startMaxl.cmd "E:\DataExtract\Scripts\MaxL-StartArchive.txt".

    Had this happen to a customer who has just improved
    Try Cmd /C E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient-32\bin\startMaxl.cmd "E:\DataExtract\Scripts\MaxL-StartArchive.txt".

  • Batch file to run the MaxL script

    Hi all

    Can someone tell me please how to run a MaxL script by using a batch file in Windows (XP). I use Essbase 11.1.1.3.

    It would be great if someone could send a .bat file, I'm not sure of the syntax.

    See you soon,.
    Sahil

    John gives you the right way re the Ref Tech.

    If you want the code, you can check my post (a bit old but still perfectly usable) here:
    http://camerons-blog-for-Essbase-hackers.blogspot.com/2009/07/fixing-plannings-filters.html

    You can download the code via this post as well.

    Kind regards

    Cameron Lackpour

  • Read metadata from the batch file

    Hello world

    I wonder if Lightroom 3 offers a feature that allows me to read metadata from file for multiple images in a batch process. The reason is that I changed the GPS information for a couple of my photos using the pluging Geoencoding support from Jeffrey Friedl and let him rewrite in the DNG file. Since I blush as the shadow data, I don't see any GPS information in my table of metadata to Lightrrom even if the data is present in the DNG format. Now, the real question is: is there a better way to get my GPS data in Lightroom that empty library and re-import all my photos?

    Oh, and before I forget: Yes, I searched this forum - and a few others as well - and I found some stuff on information in batch processing time. However, the method presented here apparently does not apply to my problem.

    Thanks for any information.

    Good day

    f.

    In the library Module, select the grid Mode. Select all the images you want to read metadata from. Go to metadata > read metadata from files

    Similarly, you can change to time zone / AM - PM problems, etc. by going to metadata > edit Capture time

  • How to read a string of file & assign val to a variable in the batch file

    Hello

    How to read a string from a file and assign the value to a variable, then return the value on the screen in the windows batch file?

    Any suggestions?

    Thank you.

    Try again with

    off @echo
    for /F "delims =" % in ('findstr /i OPEN status.log") set var = %% a
    % Var Echo%

  • How to upgrade a driver automatically in Windows NT by using the batch file

    I use the devcon tool to update a Windows XP driver, but unfortunately it does not support Windows NT. So I'm looking for a similar tool for Windows NT. Does anyone know any tool / or script that would update a driver via file/command line in Windows NT?

    Thank you for taking the time to read the question.

    Hello supportalcon,

    Thank you for the question!

    It is disheartening to know that have problems you with the Windows Driver. As I understand it, you need to update a driver automatically in Windows NT by using the batch file.

    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums. You can follow the link to your question:

    http://social.msdn.Microsoft.com/forums/en-us/categories/

    Meet us if you face any problem of Windows, and I'd be happy to help you again and try to correct the problem as soon as possible.

    Good day!

    Hope this information helps.

  • help with a simple batch file to open files or folders in command prompt

    Read the article HERE. It should guide you to accomplish what it is you want.

    @ Daavee... I am a supporter of the Holiday Inn Express. I feel always smarter after a stay... hahaha

    OP.

    Use the following syntax to open a folder

    Start "" "File path".

    Example: start "" "C: \Documents and Settings\ username to open \My Documents\File name.

    The article HERE can be useful too.

    "No, I do not use the batch files. Just thought I'd share with you what I know. :-)"  Thanks again Daavee

  • Cannot launch SNDREC32.exe minimized during playback of batch file?

    Hello

    Is it possible to launch SNDREC32.exe from a batch file, this sound recorder is reduced when it reads the file?  I got so the BACK box is hidden, but I like it if tape recorder was automatically reduced also when it reads the audio file.

    Is there command-line switches in sound recorder (SNDREC32.exe) allowing the application to be minimized automatically during playback of the file?

    Hello

    The question you posted would be better suited in the Windows XP IT Pro Forum. I would recommend posting your query in Windows XP IT Pro Forums.

    http://social.technet.Microsoft.com/forums/en/itproxpsp/threads

  • I need help doing things with batch files

    This applies to All THE VERSIONS OF WINDOWS and probably relates more to MSDOS than any other.

    cmd.exe or notepad.exe and comand.com applications

    I'm doing some kind of Setup.

    I have a tool nice lottle I did that works with a batch file. and he has 3-4 text file sthat go with it. I wanted to make a batch file which would act as an installer. make the MainMenu.txt, ReadMe.txt, Credits.txt, DISCLAIMER.txt fill them with the correct values, then make the .bat file that acts as the user interface. and when this launch the batch file under its weight made it has created (and not as a child of cmd window) then delete itself so all that remained was the new files...

    I tried the command IF [NOT] EXIST filename command because it's the only IF the syntax I have any slight understanding of

    EXAMPLE OF

    mkdir EXAMPLE

    EXAMPLE of CD

    IF [NOT] EXIST MainMenu.txt GOTO CMAIN

    : CMAIN

    ECHO the text I want to be in the lead > MainMenu.txt

    pause

    EXAMPLE OF

    but when I run the command 'Betainstall.bat' file, it opens and then closes immediately. What would be nice if it was the CASE of WAT I TOLD it to. it doesent need to be opened, because it only creates a directory then makes em fills with files on and its done... but it doesent do anything. and since it closes too quickly it's a bit hard to read all the messages that appears. (im not fast enough for print scrn) and addition of the pause at the end did not a thing. and / k has ever helped me before

    so someone who knows nothing about MS-DOS or command prompt this is a great opportunity to showcase the prowess of youre

    I just need to find how to get cmd to delete the last entry of Y.

    If I could get the Y equal to NULL it should write the %M % and not okay right?

    For the first part of what I mentioned above, you can simply do:

    SET M =

    The M variable will then to null.

    However, for what is in quotes: No. get M set to null will do what you want.  Use the command I mentioned in my previous post.  Note the signs double% to get the result of %M % in the command of the user file.

    IF the echo % M %! == 1 ! Goto: whatever > USER - X 2. 0.Bat

    Then the USER - X 2. 0.Bat will contain the line:

    IF M %! == 1 ! Goto: whatever

    Now, from your original:

    SET /p M = type OK or CANCEL, and then press ENTER:
    IF %M % IS INSTALL OK GOTO
    IF %M % IS CANCEL LEAVE
    : INSTALL

    You can see that if the M variable contains not exactly the capitals OK or CANCEL capitalized (that you specified), then the second half of each IF statement will not be executed. Your sample of what is getting written to the file USER - X 2. 0.Bat, you typed tiny ok and it works again the part of the installation of your batch file because he simply fell thru to the: part of the INSTALLATION.

    What you want is a batch program that allows to anticipate all possible ways that the user could answer "correctly". When you check if the variable M is equal to OK, it checks that specifically. All other cases the letters will not be the exact match.  That's why I ran three different lines looking for okay, okay, then OK.

    The fall same thru happen here:

    SET /p M = press on, then ENTER:
    IF %M % == y GOTO RUN
    : RUN

    Because the only thing you're looking for is there it will be Goto: EXECUTION of the IF statement , if (and only if) M is exactly there, but if it is equal to anything else it will fall through to the next line which is your: block RUN. As you have, any response is typical for the "SET/p M = press on, then ENTER", it's going to fall through and get to the: RUN block. The only exception is that if the user presses the enter only key, it will then generate the error message that I mentioned and end the batch file. That's why I used the! at the end of the two %M % and on the end of what we test, such as OK! This test if the user pressed the key entry in itself without the batch file, which gives an error.

    So, instead of this:

    IF the ECHO %M % == 1 GOTO RUN > USER - X 2. 0.bat
    IF the ECHO %M % == 2 GOTO README > USER - X 2. 0.bat
    IF the ECHO %M % == 3 CREDITS GOTO > USER - X 2. 0.bat
    IF the ECHO %M % == 4 GOTO WARNING > USER - X 2. 0.bat
    IF the ECHO %M % == 5 GOTO EOF > USER - X 2. 0.bat

    Use this:

    IF THE ECHO % M %! == 1 ! GOTO RUN > USER - X 2. 0.bat
    IF THE ECHO % M %! == 2 ! GOTO README > USER - X 2. 0.bat
    IF THE ECHO % M %! == 3 ! GOTO CREDITS > USER - X 2. 0.bat
    IF THE ECHO % M %! == 4 ! Disclaimer GOTO > USER - X 2. 0.bat
    IF THE ECHO % M %! == 5 ! GOTO EOF > USER - X 2. 0.bat

    Or use which does the same thing, but look more pretty:

    IF the echo % M %! == 1 ! Goto: run > user - X 2. 0.Bat
    IF the echo % M %! == 2 ! Goto: ReadMe > user - X 2. 0.Bat
    IF the echo % M %! == 3 ! Goto: credits > user - X 2. 0.Bat
    IF the echo % M %! == 4 ! Goto: warning > user - X 2. 0.Bat
    IF the echo % M %! == 5 ! Goto: EOF > user - X 2. 0.Bat

    (Upper and lower case for the block names all answer the same, whereas they are not nit-picky as the tests within the statement itself. I put the: before the labels of block in the IF statement so I know it's a label. I left the uppercase EOF because it is an acronym for end of file. And I use IF instead of If since it's a small order and I like it to stand. This bit is just my personal preference.)

    Another thing, you can make is for your first redirection in User - X 2. 0.Bat is to use the single > crush entire previous existence of this file. Then for forwarding the following him, continue the > who is the operator 'Add file '.

    Better yet would be first to check if the file of the user - X 2. Bat is and give the user the possibility to replace, rename, or to have an abortion.

    Clear as mud now? :)

    Edit: I just looked and I see that you are already doing the single > for the first time. Pass over my hikes on this part. Laughing out loud

  • How can I give permissions only to a running batch file?

    I have a batch file, I created and dropped on the user workstation on our network.  I need him to run it but don't want to hiim to read or see his text if it just right-click on it and choose 'change '.  I tried just giving him access under advanced performance options and it did not work.  With "read and execute" it can always display the contents of the batch file (which includes the admin password).  Is it possible to have him not being able to see the contents of the batch file, but still be able to run it?  The workstation is XP SP3

    batch file is a text file, so any user can view. If you want to hide the data, you must create an application and run by the Scheduler.

  • Batch file cannot run more

    Hello

    My BAT (the old DOS commands files) file do not run directly. I always create a shortcut and add "cmd/c" before the file name "file.bat".

    How to retrieve file executable BAT again?

    When I open directly windows writes something on devices that cannot be found. It seems that the extension is not more...

    Thanks for your help

    concerning
    Xavier

    Have one ID reader (for lack of a better term) at the top of the actual batch file allows it to race?  See my poorly written example of a batch file that works on Vista.

    C:
    CD folder
    DEL *.tmp
    DEL *.od
    DEL *.cvr
    DEL *.log
    pause

  • Windows 7 keeps looping in my batch files

    I recently bought a new computer and Windows 7 came over her.  I like it so far.  I just have a problem.  I can't run batch files.

    If I open the command prompt and type:

    stop s f

    everything works fine.  I gives me a notice that my computer shuts down in less than a minute.  But I put exactly the same inside a file, I named "shutdown.bat" command prompt appears and shows exactly what I typed, skip a line, then it displays again and again and again and again...

    So I am confused.  I've been reading about people having problems with batch files in Windows 7, but my problem seems completely different from theirs.

    Now all I know is:

    • command prompt will still receive the shutdown command
    • My batch file run when double click
    • contents of the batch file will not run

    If anyone can help?

    It is a classic case of the dog bites his tail. When you put the command

    stop s f

    in your batch file then this command executes the batch itself rather than shutdown.exe, as shutdown.bat is located in the current folder! There are several ways to solve this problem, but the safest is to avoid at all costs to name your batch file identical to a system file. Rename it to MyShutdown.bat and your problem will be solved.

Maybe you are looking for

  • Equalization of the volume and Itunes game issues

    All my songs are upgraded using mp3gain and play at the same level on my computer.  But when streaming, the volume is in every sense.  Push me bananas! Tried the Sound Check and while I note that all the songs now sound more calm, the volume between

  • Install utilities from recovery after a cleaning

    I have a HP Pavilion Elite 6 months old m9600t.  I am preparing for Windows 7 and I'm planning my upgrade strategy.  A performance I would like to install a cleaning of the reasons instead of a Vista to 7 in place upgrade.   If I do that is there a w

  • My icoud do not work in my phone but its work in computer science

    My icloud do not work in my phone but its work in computer science

  • my computer has a max of 8 memory which can make to wear this

    Is there something I can do to increase the max memory on my computer? I shows that the max on the s5-1204 is 8G. CanI get a new processor? What is the possible solution, as appropriate

  • HP netbook will not load

    Hello So basically ive just bought a netbook mini 110 HP. It works very well on the diet, but just battery does not charge. It get stuck on 0% available plugged in, load. his charge not. Ive left overnight, and the load is always 0%. I saw on another