Date: Sat, 20 Nov 2004 19:31:07 -0600
Reply-To: "Dunn, Toby" <Toby.Dunn@TEA.STATE.TX.US>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Dunn, Toby" <Toby.Dunn@TEA.STATE.TX.US>
Subject: FW: A question about macro quote
Content-Type: text/plain; charset="iso-8859-1"
Ben,
What you are looking for is quote(I) into:....
However you will find problems using the quote function given that it wants a character variable. So you could use a put statement to cover that problem, but then you will more than likely run into the problem of having leading blanks, so you need to use trim or compress function also. So with that in mind try the following:
DATA X;
DO I=1 TO 10;
OUTPUT;
END;
RUN;
PROC SQL;
SELECT QUOTE(COMPRESS(PUT(I,8.))) INTO: VLST SEPARATED BY " "
FROM X;
QUIT;
%PUT <&VLST>;
(sorry for the caps had to run it on the mainframe)
axis1 order=(1 to 10)
value=(&vlst);
proc gplot data=....
plot ..../vaxis=axis1 ;
.................;
HTH
Toby Dunn
________________________________
From: SAS(r) Discussion on behalf of Ben
Sent: Sat 11/20/2004 3:18 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: A question about macro quote
*----------------------------------------;
data x;
do i=1 to 10;
output;
end;
run;
proc sql;
select i into: vlst separated by "' '"
from x;
axis1 order=(1 to 10)
value=("&vlst");
proc gplot data=....
plot ..../vaxis=axis1 ;
.................;
I want SAS resolve &vlst in axis into
value=( '1' '2' '3' ..... '10')
thanks, I recalled there was a post here about this topic, but I simply
could not find it today.
So Could you please tell me the answer?
Many thanks