|
While you can certainly attack this by doubling quotes, using quoting
functions, and such, let me point out a couple things in the interests of
simplicity:
1) Under Windows at least, the quotes around the operating system command
are NOT required (according to SAS 8 and 9 OnlineDoc, verified for 8.2).
So, you can simply use
X START "&XLSFILE";
2) If you're worried that the above might be platform-dependent (since it's
documented in the Windows companion rather than the general language
reference manual), use %SYSEXEC instead of X. This works in open code as
well as within macro:
%SYSEXEC START "&XLSFILE";
As others have noted, the START may be superfluous here, but the same
principle should apply for other commands such as DIR (presumably to a file)
or DELETE.
Mike Rhoads
Westat
RhoadsM1@Westat.com
-----Original Message-----
From: Mark Brinkley [mailto:nospam@ABC.COM]
Sent: Monday, November 25, 2002 8:24 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Macro variables and X command
I use a macro variable to identify the name of the Excel file. For
example,
%LET XLSFILE = c:\myfile.xls;
I use the following command to start Excel from within SAS:
X "START &XLSFILE";
As is, these statements work fine.
I would like to modify the xls filename to include spaces, like so:
%LET XLSFILE = c:\my file.xls;
But now
X "START &XLSFILE";
doesn't work.
Any ideas on how to get this to work? I've tried quotes around my macro
variable
but this doesn't work.
I'm running Win2000 and sas 8.2
Thanks.
|