Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FILE OPEN ERROR WHEN USING MACRO IN FILENAME

Status
Not open for further replies.

Queryman

Programmer
Nov 4, 2002
243
0
0
US
I have the following code to open an existing file in excel, the put statement to make this work should look like this
put '[OPEN("c:\temp\c:\temp\rich.xls")]';

I changed it to
put "[OPEN("c:\temp\&client..xls")]"; to account for a filename that will be provided via a macro, I can't get this to work, any suggestions?


%let client = rich;
options noxsync noxwait xmin;
filename cmds dde 'excel|system';
data _null_;length fid rc start stop time 8;fid=fopen('cmds','s');if (fid le 0) then do;rc=system('start excel');
start=datetime();stop=start+10;do while (fid le 0);fid=fopen('cmds','s');time=datetime();if (time ge stop) then fid=1;
end;end;rc=fclose(fid);run;

data _null_; file cmds;
put "[OPEN("c:\temp\&client..xls")]";
put '[QUIT()]';run;

QueryMan

 
put '[OPEN("c:\temp\'"&CLIENT"'.xls")]';

I solved it

QueryMan

 
put '[OPEN("c:\temp\'"&CLIENT"'.xls")]';

I solved it

QueryMan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top