Date: Wed, 30 Oct 2002 09:41:33 -0600
Reply-To: "MCQUOWN, GARY" <GMCQU90@ENTERGY.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "MCQUOWN, GARY" <GMCQU90@ENTERGY.COM>
Subject: Re: into: seperated by syntax
Content-Type: text/plain
Brad;
You can concatinate "done" and " ' " on your string
with:
%let homelist = ' &types done ' ;
But if all you need is a way to determine that you
are at the end, consider a %while or %until.
/* example */
%Macro looper1(list1=);
%LET i = 1;
%DO %WHILE ((%scan(&list1, &i))>' ');
%let varn = %scan(&list1, &i);
/** code **/
%LET i = %EVAL(&i+1);
%END;
%MEND LOOPER1;
HTH;
Gary
-----Original Message-----
From: Goldman, Brad (AT-Atlanta) [mailto:Brad.Goldman@AUTOTRADER.COM]
Sent: Wednesday, October 30, 2002 9:21 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: into: seperated by syntax
Consider the following from the SAS online docs:
proc sql;
select distinct quote(style)
into :types separated by ', '
from sasuser.houses;
Anyone know if there is a way to prepend/append the &types macro variable created within this SQL step? For example, I might want the final string not to be CONDO, RANCH, SPLIT, TWOSTORY, but Houselist: 'CONDO, RANCH, SPLIT, TWOSTORY done' I can't find any reference to it... but sometimes docs do not tell all.
If there is a not a way, does anyone agree with me that it would be nice to have? For example, you could say:
proc sql;
select distinct quote(style)
into :types separated by ', ' beginning with "Houselist: '" ending with " done'"
from sasuser.houses;
Brad
|