Date: Wed, 27 Jun 2007 17:28:47 -0700
Reply-To: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Subject: Re: quote problem
Content-Type: text/plain; charset=iso-8859-1
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
> Behalf Of roch77@GMAIL.COM
> Sent: Wednesday, June 27, 2007 1:01 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: quote problem
> Thanks a lot for clarifying that Toby..
> Am I correct in saying that :
> a quote function inside a select statement in proc sql like
> "select Quote( code_pstl ) ,
> Quote( nmbr_prvnc ) ,Quote( id_adrs ) ..... "
> is different from %let aa = %quote(&aa); in a macro.
> The one inside the select does double quotes, but the %quote is as you
> I still have a problem...
> In my select statement which is below, if I don't put quote(trim())
> around code_pstl, it works fine.. If not EG hangs and I have to
> basically cntrl-alt-del and end task. Log file doesn't contain
> select quote(trim(a.code_pstl)), a.nmbr_prvnc
> into :first_code_pstl, :first_nmbr_prvnc
> from ccis_cda.addresses a, ccis_cda.client_addresses ca,
> ccis_cda.individuals i
> where i.nmbr_bin = &bin
> and i.id_indvdl = ca.id_indvdl
> and ca.id_adrs = a.id_adrs
> and a.date_crtn >= &sdt
> order by a.date_crtn asc;
> The code_pstl field is a varchar2(10) not null field and is in oracle.
I haven't seen a response to this post, so let me chime. You have asked a couple of questions about how to quote values inside a macro variable without really explaining how you are going to use the values or why they need to be quoted. You haven't written anything which convinces me that the the macro variable needs to contain quotes as opposed to supplying quotes when the variable is used.
So, how are you going to use the macro variable and why does it need to contain quotes? If you write back to the list explaining what you are really trying to do, I'm certain someone will be able to provide a solution, or at least point you in the right direction.
Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA 98504-5204