LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 26 Nov 2002 17:26:56 -0500
Reply-To:   Mike Rhoads <RHOADSM1@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Mike Rhoads <RHOADSM1@WESTAT.COM>
Subject:   Re: Macro variables and X command
Comments:   To: Mark Brinkley <nospam@ABC.COM>
Content-Type:   text/plain; charset="iso-8859-1"

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

-----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:


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


Back to: Top of message | Previous page | Main SAS-L page