Calling Vensim from SAS via DDE?
Posted: Fri Jun 20, 2008 7:46 am
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
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