Page 1 of 1

Changes for command scripts for Vensim 8+?

Posted: Thu Jul 22, 2021 9:09 am
by kleemax
I have some commmand scripts that run fine in Vensim 6.4 (x32) but that do not run in Vensim 8+
Have there been any changes to syntax? Or the way that the syntax is interpreted by Vensim?
Is there a documentation on these changes available?
I am attaching an example.
In Vensim 8.2.1 I get an error message "Unable to read commands from .cmd."
Note that I had not loaded a model. If I load a model, the error message is:
"Unable to read commands from ModelFileName.cmd."

Re: Changes for command scripts for Vensim 8+?

Posted: Thu Jul 22, 2021 12:31 pm
by Administrator
Do you have the VDF and XLS files so we can test?

Re: Changes for command scripts for Vensim 8+?

Posted: Thu Jul 22, 2021 2:14 pm
by tomfid
There haven't been any changes (other than a few additions that wouldn't affect this). Syntax checking might have become more picky somewhere.

Re: Changes for command scripts for Vensim 8+?

Posted: Thu Jul 22, 2021 2:23 pm
by tomfid
In the current v9 beta, this can be run (but fails because I don't have the source xls files). There's no indication of a syntax problem. I get the same result in 8.2.1 x64 and x32. I think we need the xls for further testing - you can email if sensitive.

Re: Changes for command scripts for Vensim 8+?

Posted: Thu Oct 27, 2022 4:01 pm
by erstring
Hi! I'm having the same problem - though let me know if I should start a new post. The .cmd file was working fine yesterday morning, and by afternoon I was getting the same message as above, with two separate .cmd files. This is one we always run when the mdl file is closed.

In an attempt to fix this, I upgraded from DSS 9.3.3 to 9.3.4 but that didn't help. I haven't yet been able to see if it happens to anyone else on our team (all traveling/out of office), but they are unfamiliar with this particular error.

We run a sensitivity analysis, then use a cmd file to create a tab file, to convert into csv for analysis in RStudio. The files aren't sensitive per se (they'll all be available publicly eventually), but several are needed if you wanted to run the mdl separately (not sure if that's necessary) so I'm not sure attaching them all here makes sense. Emailing a zip folder might be easiest.

Also, it might be relevant to know that BEFORE the "Unable to read commands from .cmd" message, I was getting "unable to open...\vensimdp.ini to read/record initilization [sic] information." I'd get that popup, but it would create the .tab file anyway. Now it just goes straight to the .cmd error.

Re: Changes for command scripts for Vensim 8+?

Posted: Thu Oct 27, 2022 4:41 pm
by Administrator
We need to see the command script.

Re: Changes for command scripts for Vensim 8+?

Posted: Thu Oct 27, 2022 5:26 pm
by erstring
I'm trying to attach it but being told it's an invalid file extension

Re: Changes for command scripts for Vensim 8+?

Posted: Thu Oct 27, 2022 5:52 pm
by erstring
I also tried uploading as a .txt file but got the same message. Best I can do is copy-paste the code unless there's someone I can email.

I'm using Notepad++ to edit - which, I just remembered I also updated yesterday so don't know if that could have changed something.

SPECIAL>NOINTERACTION
SPECIAL>LOADMODEL|OSM_Master_CURRENT_PULSE_policy.mdl
SPECIAL>LOADRUN|Treatment analysis pulse.vdfx

MENU>SENS2FILE|Treatment analysis pulse|export_manual_control_tx_analysis_pulse|T

SPECIAL>CLEARRUNS
MENU>EXIT

Re: Changes for command scripts for Vensim 8+?

Posted: Thu Oct 27, 2022 6:24 pm
by Administrator
The script does not report any errors for me.

What happens if you comment out the first and last lines so you can see what it's failing on?

Re: Changes for command scripts for Vensim 8+?

Posted: Thu Oct 27, 2022 8:16 pm
by erstring
I get the exact same popup - Unable to read commands from .cmd.

Re: Changes for command scripts for Vensim 8+?

Posted: Fri Oct 28, 2022 6:46 am
by Administrator
Can you email the files to us? Make sure you include your licence details.

You will probably need to rename the command script so it has a txt extension.

Re: Changes for command scripts for Vensim 8+?

Posted: Fri Oct 28, 2022 1:06 pm
by erstring
Sure, what email address should I send it to?

Re: Changes for command scripts for Vensim 8+?

Posted: Fri Oct 28, 2022 9:53 pm
by tomfid
vensim at vensim.com

If you .zip things, the cmd scipts usually come across OK.