LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: BONNET Christophe <Christophe.BONNET@GEP.FR>
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.


Back to: Top of message | Previous page | Main SAS-L page