Greetings!
I need to couple Vensim and SAS. Since SAS only acts as a client I tried to call Vensim directly from SAS via DDE. For some reason, Vensim does not respond to the comments that I pass to it. There is no error message from SAS. It looks like it does its job of passing the commands. The lines of code I use and the log from SAS are below this note. Could you help me getting this work? This is supposed to be very straightforward; either I am missing a simple point or maybe Vensim is not compatible with SAS?
Thank you in advance,
options noxwait noxsync;
x '"C:\Program Files\Vensim\Vensimdp.exe"';
filename tst dde 'vensim|system';
data _null_;
file tst;
put '[SPECIAL>LOADMODEL|C:\Intro.vmf]';
put '[SIMULATE>RUNNAME|C:\bob1]';
put '[MENU>RUN|O]';
put '[MENU>EXIT]';
run;
The log:
22 options noxwait noxsync;
23 x '"C:\Program Files\Vensim\Vensim.exe"'
23 ! ;
24 data _nll_;
25 x=sleep(10);
26 run;
NOTE: The data set WORK._NLL_ has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 10.01 seconds
cpu time 0.03 seconds
27 filename tsst dde 'vensim|system' command;
28 data _null_;
29 file tsst;
30 put '[SPECIAL>LOADMODEL|C:\Intro.vmf]';
31 run;
NOTE: The file TSST is:
DDE Session,
SESSION=vensim|system,RECFM=V,LRECL=256
NOTE: 1 record was written to the file TSST.
The minimum record length was 32.
The maximum record length was 32.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
Calling Vensim from SAS via DDE?
-
- Super Administrator
- Posts: 4838
- Joined: Wed Mar 05, 2003 3:10 am
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
Thanks for the replies... Unfortunately, before posting my inquiry, I had already made sure that Vensim started properly before executing the rest of the code. I had also tried running vensim.exe instead of vensimdp.exe. So none of them can be the reason for not being able to get this running.
I tried calling Vensim DLL today as Bob suggested using the data step below:
data _null_;
CALL MODULE('VdpDLL32,vensim_command',"SPECIAL>LOADMODEL|C:\Research\Intro.vmf");
run;
This time I get an error message from SAS:
ERROR: Write Access Violation In Task [ DATASTEP )
Exception occurred at (02067820)
Task Traceback
Address Frame (DBGHELP API Version 4.0 rev 5)
I am not sure if this genuinely originates from SAS or due to Vensim...
Anyway, I will continue trying to get this Vensim-SAS connection to work either thru DDE or DLL. I would appreciate any pointers along the way...
Thank you...
Burak
I tried calling Vensim DLL today as Bob suggested using the data step below:
data _null_;
CALL MODULE('VdpDLL32,vensim_command',"SPECIAL>LOADMODEL|C:\Research\Intro.vmf");
run;
This time I get an error message from SAS:
ERROR: Write Access Violation In Task [ DATASTEP )
Exception occurred at (02067820)
Task Traceback
Address Frame (DBGHELP API Version 4.0 rev 5)
I am not sure if this genuinely originates from SAS or due to Vensim...
Anyway, I will continue trying to get this Vensim-SAS connection to work either thru DDE or DLL. I would appreciate any pointers along the way...
Thank you...
Burak
-
- Super Administrator
- Posts: 4838
- Joined: Wed Mar 05, 2003 3:10 am
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm