Date: Mon, 11 Dec 2006 05:49:25 -0500
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: Help: A problem with DDE2WORD!
Try it with
%text(%quote(&test))
Regards,
Gerhard
On Mon, 11 Dec 2006 01:47:28 -0800, medpower@GMAIL.COM wrote:
>Hi, friends,
>
>When I tried to use VB macros in data step to insert macro-resolved
>texts including commas, there is always a error message told me that
>more positional parameters found than defined. However, if I directly
>used the VB code in the data step, it was ok!
>
>THe test code is as follows:
>
>%macro text(content);
> %local content;
> put '[Insert "' "&content" '"]' ;
>%mend;
>
>options NOXWAIT NOXSYNC XMIN;
>filename word dde "winword|system" ;
>%let test=%str(I like SAS very much, how about u?);
>data _null_;
> file word;
> put '[Insert "'"&test"'"]';
>run;
>
>****the above is OK;;
>
>data test;
> variable="test";
> value="I like SAS very much, how about u?";output;
>run;
>
>data _null_;
> set test;
> call symput(variable,value);
>run;
>
>%put &test;
>
>options NOXWAIT NOXSYNC XMIN;
>filename word dde "winword|system" ;
>
>data _null_;
> file word;
> put '[Insert "'"&test"'"]';
>run;
>
>***the above is also right;
>***but the following does't work;
>
>data _null_;
> file word;
> %text(%str(&test));
>run;
>
>What's the prpblem here?
>Much appreciations!
>
>Stanley
|