Date: Fri, 18 Oct 2002 11:53:55 -0400
Reply-To: "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Subject: Re: Sql question
Content-Type: text/plain; charset="iso-8859-1"
Christophe,
If you explicitly convert x to a character value in your SQL the formatted
value goes away.
proc sql;
select distinct put(x,best.) into : list separated by "@" from a;
quit;
Kind Regards,
__________________________
Venky Chakravarthy
E-mail: swovcc@hotmail.com
-----Original Message-----
From: BONNET Christophe [mailto:Christophe.BONNET@GEP.FR]
Sent: Friday, October 18, 2002 10:39 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Sql question
Hi everyone,
I've got a question about proc sql.
I use this procedure to put the distinct values of a variable into a
macro-variable. For instance :
proc sql;
select distinct x into : list separated by " " from _data_;
quit;
Now when x is a formatted variable, the values put in the list are the
formatted values. I'd like to know if there's a simple way to get the
internal value.
For example in the following program, the content of the macro-variable x is
YES@NO@DNK, and i would like it to be 1@2@3
proc format;
value type;
1="YES"
2="NO"
3="DNK"
;
run;
data a;
input x;
cards;
1
2
1
3
;
format x type.;
run;
proc sql;
select distinct x into : list separated by "@" from a;
quit;
Any help appreciated. Thanks in advance.
Christophe
PS : Could you please answer me personnally since i don't receive SAS-L
mails.