Running Aimms Procedure from Command Line

430 views
Skip to first unread message

navin...@gmail.com

unread,
Aug 31, 2012, 6:20:53 PM8/31/12
to ai...@googlegroups.com
Hi,

I have a Procedure in AIMMS that communicates with an external database and loads some sets and parameters. I am trying to see how this can be accomplished using AIMMSCMD tool but I see that it does not support running procedures that contain arguments (I get the error message "Procedure Run Failed"). Is there any workaround?

Thanks

Naveen

Guido Diepen

unread,
Sep 1, 2012, 3:42:07 AM9/1/12
to ai...@googlegroups.com
Hi Naveen,

please see the answer in an earlier question thread on this google group: https://groups.google.com/d/msg/aimms/BPyoM_aOR-E/lnzc8C8XJyIJ

Guido Diepen
AIMMS Specialist

navin...@gmail.com

unread,
Sep 6, 2012, 1:19:06 PM9/6/12
to ai...@googlegroups.com
Hi Guido,

Thanks for the tip, the thread and the related blog were quite informative. So my understanding is that I can save a case from a run and/or load the case using AIMMS CMD tool following which I can call the main optimization function.However, it's not possible for me to load a case by calling a database procedure in AIMMS for every run. Please correct me if I am wrong.

Thanks and Regards,

Naveen 

Peter Nieuwesteeg

unread,
Sep 13, 2012, 12:42:15 AM9/13/12
to ai...@googlegroups.com
Hi Naveen,

Guido was referring to the following statement to circumvent the fact that aimmscmd doesn't allow for arguments:
The run statement of the AimmsCmd tool does not support running procedures that have arguments. This means that if you want to have a procedure that loads a given case via the AimmsCmd, you must do so by introducing a new string parameter CaseToLoad, which you assign a value with the let statement. After that, you have to execute a procedure that will load the case denoted by the value of the string parameter CaseToLoad. 

In this particular case, the goal was to load a case, but the main idea is that you need to create an extra parameter (instead of argument) and then set this via the let statement. This means that you should be able to read data from a database using the command line tool.

Peter Nieuwesteeg
Senior AIMMS Specialist

navin...@gmail.com

unread,
Sep 14, 2012, 8:01:00 PM9/14/12
to ai...@googlegroups.com
Hi Peter,

Thanks for the response. When I try to run a simple procedure (with a directsql command followed by a read from table command) to communicate with Oracle through AIMMSCMD tool, I get the error "Procedure Run Failed". But I expect a prompt asking for the connection parameters (the procedure works fine when I run it in AIMMS instead of cmd tool). This is why I am a little confused with the capability of the AIMMSCMD tool. However, I am able to run other procedures from the tool.

Any suggestion on this particular issue?

Thanks

Naveen  

Peter Nieuwesteeg

unread,
Sep 16, 2012, 11:37:01 PM9/16/12
to ai...@googlegroups.com
Hi Naveen,

The AIMMSCMD runs without any user interaction, all dialog boxes are automatically suppressed. This explains the behavior that you see, because you are not given the option to specify the connection parameters the run will fail.

Can you explain what you are trying to accomplish?
- Why do you want to use the AIMMSCMD line tool?
- Why do you want to specify the connection parameters interactively?

Thanks,
Peter
Senior AIMMS specialist

navin...@gmail.com

unread,
Sep 17, 2012, 12:41:20 PM9/17/12
to ai...@googlegroups.com
Hi Peter,

I have a database procedure that communicates with Oracle, retrieves data and maps it onto a database table in AIMMS. The values in the remote database may change frequently, so I would like to call this database procedure before running the main optimization procedure. 

I just  wanted to see if this was possible to achieve by means of a command line argument. I thought it might come handy when we wanted to do a single run of our AIMMS project during some demos. 


Thanks

Naveen
Reply all
Reply to author
Forward
0 new messages