=========================================================================
Date: Tue, 11 Jul 2006 16:56:07 -0400
Reply-To: RAbraham@aaalife.com
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Renji Abraham <RAbraham@aaalife.com>
Subject: Re: reverse concat
In-Reply-To: <s4b3d370.097@GW_SERVER>
Content-Type: text/plain; charset="US-ASCII"
Hi Monica,
Try this.
* If I understand your question correctly your current social security
number is this form 'xxx-xx-xxxx' and you want it in 'xxxxxxxxx' ( i.e.
without the dashes).
STRING PART1 (A3) .
COMPUTE PART1 = SUBSTR (SSN,1,3) .
EXECUTE .
STRING PART2 (A2).
COMPUTE PART2 = SUBSTR (SSN,5,2) .
EXECUTE .
STRING PART3 (A4).
COMPUTE PART3 = SUBSTR (SSN,8,4).
EXECUTE .
STRING SSN_NEW (A9) .
COMPUTE SSN_NEW = CONCAT (PART1,PART2,PART3) .
EXECUTE .
DELETE VARIABLES PART1 PART2 PART3 .
This is a long solution. I think others would have an easier solution .
HTH,
Renji
Monica Perry <mperry@pitt.k12.nc.us>
Sent by: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
07/11/2006 04:35 PM
Please respond to
Monica Perry <mperry@pitt.k12.nc.us>
To
SPSSX-L@LISTSERV.UGA.EDU
cc
Subject
reverse concat
Hello List,
I need to remove dashes from social security numbers, and I'm having
some trouble.
To put them in I use the concat function in the compute dialog box:
SSnumD=concat(substr(SSnum,1,3),'-',substr(SSnum,4,2),'-',substr(SSnum,6,4))
I tried taking the dash out of the '-' parts; leaving it blank the
first time, like this --> ' '
and removing the space the second time, like this --> ''
I figured it would read as "From position 1 go 3 spaces, enter nothing,
From position 4 go 2 spaces, enter nothing" (instead of reading ' enter
dash')
Is there such a thing as unconcatenate?
Any tips would be appreciated.
Thanks, Monica
Monica Perry
Title 1 Program Specialist
Pitt County Schools, Greenville NC