Date: Tue, 2 Oct 2007 20:09:45 -0500
Reply-To: barthr@uic.edu
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Barth Riley <barthr@uic.edu>
Organization: UIC
Subject: Re: breaking up (a string variable) is hard to do
In-Reply-To: <9A37D712ED85C6438DDA21C4F044141203AE7AC5@sagemsg0024.sagemsmrd01.sa.gov.au>
Content-Type: text/plain; charset="us-ascii"
Try this:
Create a variable called index as follows:
Index = INDEX(oldvar,"-")
Then create newvar as follows:
Newvar =
CONCAT(SUBSTR(oldvar,1,index-1),SUBSTR(oldvar,index+1,INDEX(SUBSTR(oldvar,in
dex+1),"-")-1))
|