Date: Mon, 13 Aug 2001 14:13:26 -0700
Reply-To: "Huang, Ya" <ya.huang@AGOURON.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <ya.huang@AGOURON.COM>
Subject: Re: Decode in SAS SQL
Content-Type: multipart/alternative;
proc sql;
select case when plan='p2' then 'p2' else 'p1' end as plan
from yourdata
;
> -----Original Message-----
> From: Isson, Jean-Paul [mailto:Jean-Paul.Isson@MICROCELL.CA]
> Sent: Monday, August 13, 2001 2:07 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Decode in SAS SQL
>
>
> Hi evryone,
> I have a little question where I intend to use the sql
> decode function.
> I am extracting data from Oracle data source using
> sas proc sql.
> One of my variable called plan has value P1 P12 P13 P14 and P2.
> I would like to import var plan by decoding variable
> plan as the following:
> if plan in (P11, P12, P13, P14) plan=P1 else plan=P2.
> I would like to do this in sql procedure without using
> a data step.
> Does any one know How can I do that?
> I appreciate any hint or idea from
>
[text/html]
|