|
|
SAS-Excel: DDE syntax error in physical name.
Hello.
I=B4m triying to open an Excel sheet using SAS.
I use this code:
[
filename excdata dde 'Excel|System';
OPTIONS XSYNC NOXWAIT;
data _null_;
length fid rc start stop time 8;
fid=3Dfopen('excdata','s');
if (fid le 0) then do;
rc=3Dsystem('start Excel');
start=3D datetime();
stop=3Dstart+100;
do while (fid le 0);
fid=3Dfopen('excdata','s');
time=3Ddatetime();
if (time ge stop) then fid=3D1; end;
end;
rc=3Dfclose(fid);
run;
data _null_;
file excdata;
put '[Open("C:\\ptrn.xls")]';
put '[Run("mc_fill",FALSE)]';
run;
]
It works in my computer, but when I try to execute this in other PC
with SAS 9 and Excel 2003 SP3, Its appears this error: "DDE syntax
error in physical name".
SAS open correctly the SAS application but when it try to execute this
sentence: file excdata; is when the error occurs.
Can do you please help me?
Thank you in advance.
|
|
0
|
|
|
|
Reply
|
sinh
|
1/5/2011 9:25:33 AM |
|
On Jan 5, 1:25=A0am, sinh 0 <pascua...@gmail.com> wrote:
> Hello.
>
> I=B4m triying to open an Excel sheet using SAS.
>
> I use this code:
>
> [
> =A0 =A0 =A0 =A0 filename excdata dde 'Excel|System';
>
> =A0 =A0 =A0 =A0 OPTIONS XSYNC NOXWAIT;
>
> =A0 =A0 =A0 =A0 data _null_;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 length fid rc start stop time 8;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fid=3Dfopen('excdata','s');
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (fid le 0) then do;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rc=3Dsystem('start Excel');
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 start=3D datetime();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 stop=3Dstart+100;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 do while (fid le 0);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fid=3Dfopen('excdata','s'=
);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 time=3Ddatetime();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (time ge stop) then fi=
d=3D1; end;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 end;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rc=3Dfclose(fid);
> =A0 =A0 =A0 =A0 run;
>
> =A0 =A0 =A0 =A0 data _null_;
> =A0 =A0 =A0 =A0 =A0 =A0 file excdata;
> =A0 =A0 =A0 =A0 =A0 =A0 put '[Open("C:\\ptrn.xls")]';
> =A0 =A0 =A0 =A0 =A0 =A0 put '[Run("mc_fill",FALSE)]';
> =A0 =A0 =A0 =A0 run;
>
> ]
>
> It works in my computer, but when I try to execute this in other PC
> with SAS 9 and Excel 2003 SP3, Its appears this error: "DDE syntax
> error in physical name".
>
> SAS open correctly the SAS application but when it try to execute this
> sentence: file excdata; is when the error occurs.
>
> Can do you please help me?
>
> Thank you in advance.
Not sure where the bug is in your code but the code I use is:
x ' "C:\Program Files\Microsoft Office\OFFICE11\excel.exe" ';
filename cmds dde 'excel|system';
/* Wait for application to start up */
data _null_;
x=3Dsleep(2);
run;
data _null_;
file cmds ;
/* Open file */
put '[Open("C:\\ptrn.xls")]';
run;*/;
Works fine on any computer I've tried.
|
|
0
|
|
|
|
Reply
|
Reeza
|
1/5/2011 5:29:50 PM
|
|
It works correctly but when it execute the put command (put '[Open("C:\
\ptrn.xls")]'; ), it=B4s appears this error: "Physical file does not
exist, excel|system".
Than you so much.
|
|
0
|
|
|
|
Reply
|
sinh
|
1/11/2011 8:38:36 AM
|
|
On Jan 5, 10:25=A0am, sinh 0 <pascua...@gmail.com> wrote:
> Hello.
>
> I=B4m triying to open an Excel sheet using SAS.
>
> I use this code:
>
> [
> =A0 =A0 =A0 =A0 filename excdata dde 'Excel|System';
>
> =A0 =A0 =A0 =A0 OPTIONS XSYNC NOXWAIT;
>
> =A0 =A0 =A0 =A0 data _null_;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 length fid rc start stop time 8;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fid=3Dfopen('excdata','s');
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (fid le 0) then do;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rc=3Dsystem('start Excel');
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 start=3D datetime();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 stop=3Dstart+100;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 do while (fid le 0);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fid=3Dfopen('excdata','s'=
);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 time=3Ddatetime();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (time ge stop) then fi=
d=3D1; end;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 end;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rc=3Dfclose(fid);
> =A0 =A0 =A0 =A0 run;
>
> =A0 =A0 =A0 =A0 data _null_;
> =A0 =A0 =A0 =A0 =A0 =A0 file excdata;
> =A0 =A0 =A0 =A0 =A0 =A0 put '[Open("C:\\ptrn.xls")]';
> =A0 =A0 =A0 =A0 =A0 =A0 put '[Run("mc_fill",FALSE)]';
> =A0 =A0 =A0 =A0 run;
>
> ]
>
> It works in my computer, but when I try to execute this in other PC
> with SAS 9 and Excel 2003 SP3, Its appears this error: "DDE syntax
> error in physical name".
>
> SAS open correctly the SAS application but when it try to execute this
> sentence: file excdata; is when the error occurs.
>
> Can do you please help me?
>
> Thank you in advance.
Use C:\ and not C:\\
|
|
0
|
|
|
|
Reply
|
RolandRB
|
1/14/2011 12:46:34 PM
|
|
You=B4re right. It works on my computer, but still doesnt work on the
other computer.
I think the problem could be the SAS version of this computer cant use
the component DDE. I dont know if exist a DDE installer to SAS.
Thanks!
|
|
0
|
|
|
|
Reply
|
sinh
|
1/19/2011 9:51:50 AM
|
|
|
4 Replies
521 Views
(page loaded in 0.098 seconds)
|
|
|
|
|
|
|
|
|