Date: Tue, 19 Feb 2008 16:55:05 -0500
Reply-To: Ya Huang <ya.huang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ya Huang <ya.huang@AMYLIN.COM>
Subject: Re: SAS Coding Question
data xx;
length newv $50;
input x $50.;
newv=left(tranwrd(tranwrd(tranwrd(x,'A;',''),'B;',''),'C;',''));
cards4;
A;B;C;south asian;
C;Indian;
A;C;B;
;;;;
proc print;
run;
Obs newv x
1 south asian; A;B;C;south asian;
2 Indian; C;Indian;
3 A;C;B;
On Tue, 19 Feb 2008 13:41:22 -0800, Xuhong <zhuxuhong2000@GMAIL.COM> wrote:
>Hello folks,
>
>I need your help with my coding scheme.
>
>I have a variable falling into the following pattern:
>
>A;B;C;south asian;
>C;Indian;
>A;C;B;
>...
>
>What I want is to find a method to create a new variable which will
>contains
>the text fields which are not the 'A' and 'B' and 'C'.
>
>Thanks a lot!
|