|
<html>
At 09:13 AM 11/26/2002 -0500, Ian Whitlock wrote:<br><br>
<blockquote type=cite class=cite cite>Mark,<br><br>
One time honored solution is indicated by<br><br>
%let fn = c:\junk\this is data to be deleted.txt ;<br>
x "type ""&fn"""
;<br><br>
The problem with<br><br>
%let fn = 'c:\junk\this is data to be deleted.txt' ;<br>
x "type '&fn'" ;<br><br>
is that on my system Windows 98 the message "TOO MANY
PARAMETERS" is<br>
returned. I think it probably has something to do with the fact
that single<br>
quotes are legitimate in filenames.</blockquote><br><br>
<br>
Where is the Electric Horseman (aka: Kilo Volt) when we need him,
eh?<br><br>
Indeed, this *is* a bugger, and alas, I have no answer either ... just
some observations.<br><br>
Using Win 2K Pro ...<br><br>
1st off, even in a Command Prompt (i.e., DOS box), starting at C:>, I
could not get the START command:<br><br>
<font color="#0000FF">START "F:\My Documents\Excel\Final 00-01 OBRA
figures.XLS" <br><br>
</font>to work. <br><br>
Typing <font color="#0000FF">START /? </font>gives:<br><br>
<font color="#0000FF">non-executable files may be invoked through their
file association just<br>
by typing the name of the file as a command.
(e.g. WORD.DOC would<br>
launch the application associated with the .DOC file
extension).<br>
See the ASSOC and FTYPE commands for how to create
these<br>
associations from within a command script.<br><br>
</font>which to me implies that it should, however I suspect it only
works when you're in the same directory, for if I changed drives to
<font color="#0000FF">F:</font> and directories to
<font color="#0000FF">"My Documents\Excel"</font> and then
issued:<br><br>
<font color="#0000FF">"Final 00-01 OBRA figures.XLS"Final 00-01
OBRA figures.XLS" <br><br>
</font>then Excel would start and load that spreadsheet. I could also
issue the following command:<br><br>
<font color="#0000FF">"D:\Microsoft Office\Office\excel.exe"
"F:\My Documents\Excel\Final 00-01 OBRA figures.XLS"<br><br>
</font>and again, Excel would start and load that spreadsheet.<br><br>
....<br><br>
So, in SAS (v8.2), I tried<br><br>
<font color="#0000FF">options</font> noxsync mprint mlogic symbolgen
;<br>
<font color="#0000FF">%let</font> exe =
"D:\Microsoft Office\Office\excel.exe" ;<br>
<font color="#0000FF">%let</font> xlsfile = "F:\My
Documents\Excel\Final 00-01 OBRA figures.XLS" ;<br><br>
<font color="#0000FF">x</font> <font color="#800080">"&exe
&xlsfile"</font> ;<br><br>
<font color="#008000">*-- x "D:\Microsoft
Office\Office\excel.exe" &xlsfile" ;<br>
*-- x ""D:\Microsoft Office\Office\excel.exe""
&xlsfile" ;<br><br>
*-- x '"D:\Microsoft Office\Office\excel.exe" "F:\My
Documents\Excel\Final 00-01 OBRA figures.XLS"' ;<br>
*-- x 'f: & cd "My Documents\Excel" & "Final 00-01
OBRA figures.XLS"' ;<br><br>
</font>and the <font color="#0000FF">x</font>
<font color="#800080">"&exe &xlsfile"</font>
worked.<br><br>
Note: neither of the first two commented-out X-statements worked (when un-commented-out of course <g>); also if you look these two in the Enhanced Editor you will see the differing colors that should give a hint that it would not work beforehand:<br><br>
<font color="#0000FF">x</font> <font color="#800080">"D:\Microsoft Office\Office\excel.exe"</font> &xlsfile<font color="#800080">" ;<br><br>
</font>and<br><br>
<font color="#0000FF">x</font> <font color="#008080"><b>""D</b></font>:\Microsoft Office\Office\excel.exe<font color="#800080">""</font> &xlsfile<font color="#008080"><b>" ;<br><br>
</b></font>Also, the latter two commented-out X-statements did work (i.e., w/ no macro var being used).<br><br>
Thus is it appears that since you've got to have the X-statement in double quotes to get the macro var to resolve, that precludes any other use of double quotes within that X-statement.<br><br>
Lastly, noting that<br><br>
<font color="#0000FF">x</font> <font color="#008080"><b>""D</b></font>:\Microsoft Office\Office\excel.exe<font color="#800080">""</font> &xlsfile<font color="#008080"><b>" ;<br><br>
</b></font>from above didn't work (basically seeing x "" as meaningless), I tried:<br><br>
<font color="#0000FF">x</font> <font color="#800080">"""D:\Microsoft Office\Office\excel.exe""&xlsfile"</font> ;<br><br>
which did open Excel, however, the spreadheet was not.<br><br>
HTH<br><br>
<br>
<div>------------------------------------------------------------</div>
<div>William W. Viergever Voice : (916) 483-8398</div>
<div>Viergever & Associates Fax : (916) 486-1488</div>
<div>Sacramento, CA 95825 E-mail : wwvierg@attglobal.net</div>
<div>------------------------------------------------------------</div>
<br>
</html>
|