Date: Wed, 22 Sep 2010 16:04:58 -0700
Reply-To: Paul Miller <pjmiller_57@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul Miller <pjmiller_57@YAHOO.COM>
Subject: Conditional find and replace in a text string
In-Reply-To: <201009211846.o8LAnPku012795@willow.cc.uga.edu>
Content-Type: text/plain; charset=iso-8859-1
Hello All,
Below is snippet from a design file for a conjoint analysis.
data test;
input text $50.;
cards;
1 1 8 25 0
0
2 1
1 1 1 2 3 2 3 5
2 3 3 3 1 1 2 4
2 0
;
run;
I'd like to do a find and replace that changes some of the values in lines with length = 15 (lines 4 and 5 in this example) according to the following set of criteria:
position action
1 do nothing
2 1=3,2=2,3=1
3 1=3,2=2,3=1
4 do nothing
5 1=3,2=2,3=1
6 1=3,2=2,3=1
7 1=3,2=2,3=1
8 do nothing
where position is the location of the number within the text string.
Does anyone now a good way of doing this?
Thanks,
Paul
|