Date: Mon, 16 Sep 2002 08:25:19 -0400
Reply-To: Magnus Mengelbier <magnus.mengelbier@FERRING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Magnus Mengelbier <magnus.mengelbier@FERRING.COM>
Subject: Re: Memory problem with SAS 8 to Excel via DDE under Windows NT
Hello Peter and Lolek
Peter wrote:
>Another mistake I made proved to be informative.
>Having already started an excel session and killed
>book1, the dde triplet generated an error, but still
>the file processing consumed the memory without
>releasing it !
Mistakes are my favourite tutors ... the wonderfull world of macro
processing ... I did bite that bullet too. Maybe the result is not
suprising since the macro code is analogous to writing the data step 1000
times. I suspect that this is more than just an SI issue. I am starting to
believe this is also dependent how and when Windows lets SAS release
connection resources because ...
... as the plot thickens ...
I ran the following code in both interactive and batch mode on a
conservative system we have here. Basically
- Win98
- Office 97 (SR2)
- SAS 8.2 (TS2M0)
and without producing any errors. Only thing I noticed was that the system
felt a little sluggish for a minute after the run, but still very workable.
Maybe this is a Microsoft problem, ie newer version of Excel not releasing
the connection back to SAS. Maybe one should send over a dde flush (can
not remember the syntax) before continuing with the next itteration in the
loop.
Magnus
---------- The code -----------
%macro aaa;
filename dane dde "Excel|[Book1]Sheet1!R1C1:R10000C3" notab;
%do i = 1 %to 1000;
%put ----------------------------------------;
%put ;
%put &i;
%put;
%put ----------------------------------------;
data _null_;
file dane lrecl=1048576;
do i = 1 to 10000;
put 'aaa' '09'x 'bbb' '09'x 'ccc';
end;
run;
%end;
filename dane;
%mend;
%aaa;
-------- end of code -------------
<snip>