MS Access DDE Selectively Quotes Strings

  • Follow


I'm using dynamic data exchange (DDE) to read text strings from a Microsoft
Access database into SAS. If (and only if) Access sees a quotation mark in
any text value, it quotes the value and doubles the original quotation
marks.

For example,

   A "funny" result

becomes

   "A ""funny"" result"

I know it's happening on the Access side because I've dumped the _INFILE_
variable and I see the extra quotation marks.

I'd like to find a way to inhibit MS Access from doing this.

Next best would be a simple way to have SAS undo it, like a $QUOTE informat
or an UNQUOTE function (neither of which seems to exist).

Last resort will be to use SUBSTR, TRANWRD, and so forth to undo it. I know
how to do that. I'd just prefer to avoid it.
0
Reply Howard_Schreier (1506) 2/27/2004 8:16:41 PM

Howard,

The following seems to work (Plan B):

DATA _NULL_;
LENGTH Original Revised $ 30;
INPUT Original & ;
Revised = INPUT(Original,$QUOTE30.);
PUT Original= / Revised= // ;
CARDS;
"A ""funny"" result"
A not-so-funny result
RUN;

Seems like the informat ought to be called $UNQUOTE not $QUOTE, but greater
minds than ours ...

Mike Rhoads
Westat
RhoadsM1@Westat.com

-----Original Message-----
From: Howard Schreier [mailto:Howard_Schreier@ITA.DOC.GOV]
Sent: Friday, February 27, 2004 3:17 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: MS Access DDE Selectively Quotes Strings


I'm using dynamic data exchange (DDE) to read text strings from a Microsoft
Access database into SAS. If (and only if) Access sees a quotation mark in
any text value, it quotes the value and doubles the original quotation
marks.

For example,

   A "funny" result

becomes

   "A ""funny"" result"

I know it's happening on the Access side because I've dumped the _INFILE_
variable and I see the extra quotation marks.

I'd like to find a way to inhibit MS Access from doing this.

Next best would be a simple way to have SAS undo it, like a $QUOTE informat
or an UNQUOTE function (neither of which seems to exist).

Last resort will be to use SUBSTR, TRANWRD, and so forth to undo it. I know
how to do that. I'd just prefer to avoid it.
0
Reply RHOADSM1 (795) 2/27/2004 8:45:49 PM


1 Replies
53 Views

(page loaded in 0.075 seconds)


Reply: