SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

CMDEXCEL - single quote

Reply
Occasional Contributor
Posts: 16

CMDEXCEL - single quote

I am attempting to open an Excel spreadsheet but because I have a single quote in the location, it's dying on me. Can I get around it? I've tried using a macro var in place of the network location but haven't had any success with that.

DATA _NULL_;
FILE CMDEXCEL;
PUT '[OPEN("N:\PUBLIC\Chip's Adhocs\ADHOCS 2006\balanced_scorecard\XLS\Balance Scoreard Data.xls")]';
RUN;
SAS Employee
Posts: 7

Re: CMDEXCEL - single quote

Have you tried adding another ' changing Chip's to Chip''s?

5 DATA _NULL_;
6 FILE CMDEXCEL;
7 PUT '[OPEN("C:\Temp\Todd's Test\Book1.xls")]';
--------------------- -
49 22
---------
201
NOTE 49-169: The meaning of an identifier after a quoted string may change in a future SAS
release. Inserting white space between a quoted string and the succeeding
identifier is recommended.

ERROR 22-322: Syntax error, expecting one of the following: a name, an integer constant,
arrayname, #, $, &, (, +, -, /, //, :, ;, =, ?, @, @@, OVERPRINT, [, _ALL_,
_BLANKPAGE_, _ODS_, _PAGE_, {, ~.

ERROR 201-322: The option is not recognized and will be ignored.

8 RUN;
9
10 '"*;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 4.79 seconds
cpu time 0.01 seconds



11 DATA _NULL_;
12 FILE CMDEXCEL;
13 PUT '[OPEN("C:\Temp\Todd''s Test\Book1.xls")]';
14 RUN;

NOTE: The file CMDEXCEL is:
File Name=C:\Documents and Settings\sasshb\cmdexcel.dat,
RECFM=V,LRECL=256

NOTE: 1 record was written to the file CMDEXCEL.
The minimum record length was 39.
The maximum record length was 39.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.00 seconds
Post a Question
Discussion Stats
  • 1 reply
  • 268 views
  • 0 likes
  • 2 in conversation