Date: Sun, 3 Sep 2006 18:46:48 -0400
Reply-To: Joe Whitehurst <joewhitehurst@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Whitehurst <joewhitehurst@GMAIL.COM>
Subject: Re: Macro string from Proc Sql
In-Reply-To: <090320062022.20533.44FB3988000DCA2C00005035220922462705029A06CE9907@comcast.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Ian,
As I have said many times before, blah blah blah SAS Component
Lnnguage, blah blah blah Antiquated Macro Language blah blah blah!
Joe
On 9/3/06, Ian Whitlock <iw1junk@comcast.net> wrote:
> Dramage,
>
> Just remember that the value looks good but it isn't. The outside
> single quotes remain quoted. You need
>
> %unquote(&mvar)
>
> to use the expression in most code. On the other hand,
> it might be better to standardize on double quotes around
> the values.
>
> Ian Whitlock
> ===============
> Date: Thu, 31 Aug 2006 21:11:11 -0700
> Reply-To: dramage <dramage1@GMAIL.COM>
> Sender: "SAS(r) Discussion"
> From: dramage <dramage1@GMAIL.COM>
> Organization: http://groups.google.com
> Subject: Re: Macro string from Proc Sql
> Comments: To: sas-l
> In-Reply-To: <1157077760.020497.264170@m73g2000cwd.googlegroups.com>
> Content-Type: text/plain; charset="iso-8859-1"
> Try this:
> data test;
> input testvar $20.;
> datalines;
> 01234
> 43210
> 56789
> 99999
> ;
> run;
> proc print; run;
> proc sql;
> select testvar into: mvar separated by "','"
> from test;
> quit;
> %let mvar=%str(%')&mvar%str(%');
> %put &mvar;
>
> auto208611@hushmail.com wrote:
> > Is there a method within this Proc Sql that I can get
> > the creation of a macro list to have to have a single
> > quote on both sides of the comma, so that final
> > macro string resluts in this string:
> >
> > '01234','43210','56789','99999'
> >
> > proc sql noprint ;
> > select zipnum into :zips separated by ',' from dataset1;
> >
> > Thanks
>
--
To paraphrase G. Santayana, the SAS Macro Facility used by common SAS
programmers is an old mate that gives no pleasure and many headaches,
yet she/he cannot live without it, and resents any aspersions that
strangers may cast on its character
|