Date: Tue, 14 Aug 2001 01:39:19 -0400
Reply-To: Richard DeVenezia <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Richard DeVenezia <radevenz@IX.NETCOM.COM>
Organization: MindSpring Enterprises
Subject: Re: Decode in SAS SQL
Jean-Paul:
You can either decode() on the Oracle side (if using SQL pass-through) or
use a variety of SAS techniques on the SAS side.
Here's two
1. SQL case statement
select
...
, case
when (plan in ('P11' 'P12' 'P13' 'P14')) then 'P1'
else 'P2'
end as plan
...
from connection to oracle
(select ..., plan, ... from ...))
...
2. custom formats
RTFM
--
Richard DeVenezia - SAS Macros and AF Tools
http://www.devenezia.com
"Isson, Jean-Paul" <Jean-Paul.Isson@MICROCELL.CA> wrote in message
news:57A36753B9EBD211B5C50008C75D605702B8D8CF@DMTLCMIS03...
> 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
|