Date: Fri, 11 Jan 2008 09:23:12 -0600
Reply-To: "data _null_," <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_," <datanull@GMAIL.COM>
Subject: Re: Resolving Macro
In-Reply-To: <c1dafc56-aaeb-4e73-a2ae-a9a58b103e36@f47g2000hsd.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
I think BQUOTE and UNQUOTE can help here.
%unquote(%bquote('&name'))
UNQUOTE is needed also to undo the quoting applied by BQUOTE to
resolve &NAME within single quotes.
On Jan 11, 2008 9:13 AM, raghur6@gmail.com <raghur6@gmail.com> wrote:
> Ex:-
>
> %let name = abcd3e;
> %let Code = 1233;
>
>
> proc sql;
>
> create table new as select * from DB1.Table1 where name_1 = '&name'
> and Code_1 = &Code;
>
> quit;
>
>
> I have established connection to Sql Server database from SAS i wanted
> to extract data from
>
> DB1.Table1 with matching name and code values. Both name and code are
> macro variables
>
> The problem i am facing is to extract matcing data from Sql server we
> have to pass with in
>
> single Quote EX Here: '&name'
>
> the macro is not resolved if i do so
>
> i cant pass in double Quote nor &name, single quote is compulsary
>
> Can any one let me know how do i resolve macro and pass in single
> quote.
>
> Thanks,
> Raghu
>
|