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
You can either decode() on the Oracle side (if using SQL pass-through) or
use a variety of SAS techniques on the SAS side.
1. SQL case statement
when (plan in ('P11' 'P12' 'P13' 'P14')) then 'P1'
end as plan
from connection to oracle
(select ..., plan, ... from ...))
2. custom formats
Richard DeVenezia - SAS Macros and AF Tools
"Isson, Jean-Paul" <Jean-Paul.Isson@MICROCELL.CA> wrote in message
> Hi evryone,
> I have a little question where I intend to use the sql decode
> 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
> 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