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 (January 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 11 Jan 2008 15:26:03 +0000
Reply-To:     iw1junk@COMCAST.NET
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ian Whitlock <iw1junk@COMCAST.NET>
Subject:      Re: Resolving Macro
Comments: cc: "raghur6@gmail.com" <raghur6@GMAIL.COM>

Summary: Hide and then unquote #iw-value=1

Raghu,

proc sql;

create table new as select * from DB1.Table1 where name_1 = %unquote(%str(%')&name%str(%')) and Code_1 = &Code;

quit;

Ian Whitlock Date: Fri, 11 Jan 2008 07:13:01 -0800 Reply-To: "raghur6@gmail.com" <raghur6@GMAIL.COM> Sender: "SAS(r) Discussion" From: "raghur6@gmail.com" <raghur6@GMAIL.COM> Organization: http://groups.google.com Subject: Resolving Macro Comments: To: sas-l Content-Type: text/plain; charset=ISO-8859-1

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


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