Date: Tue, 2 Sep 2003 16:50:41 -0400
Reply-To: Mark Casazza <mark.casazza@domino1.cuny.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Mark Casazza <mark.casazza@domino1.cuny.edu>
Subject: Re: Alphanumeric format question-Juan Albertorio
In-Reply-To: <DF8D74DEC0769E4CBE4CF58D2AA3EA13122F6B@m-nchs-1.nchs.cdc.gov>
Content-Type: text/plain; charset="iso-8859-1"
Hi Juan,
If your first variable is a six-character string you'll need to create
a new variable that's seven characters, and even if you've got room to
put the decimal in the original I'd advise creating a new variable so
you can verify that the syntax did what you wanted. That said, this
produces a new variable with the decimal:
--
data list fixed /strvar 1-6 (a).
begin data
A12345
end data.
string nstrvar (a7).
compute nstrvar = concat(substr(strvar,1,2),'.',substr(strvar,3,4)).
list.
--
Mark Casazza
Director of Academic Information
The City University of New York
555 West 57th St. Suite 1240
New York, NY 10019
phone: 212.541.0396
fax: 212.541.0372
mark.casazza@mail.cuny.edu
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf
Of
Albertorio, Juan R.
Sent: Tuesday, September 02, 2003 3:24 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Alphanumeric format question-Juan Albertorio
Dear SPSS list. I have a format question.
I have a database that contains an alphanumeric variable of six
igits -ICD
9 CM code.
I want to assign a decimal point following the second character and
keep the
variable as alphanumeric.
Did someone have any clue of how to do this?
Thanks in advance.
Juan
________________________________________________
Juan R. Albertorio-Díaz, MA
Statistician
Office of International Statistics, Office of the Center Director
National Center for Health Statistics
Center for Disease Control and Prevention
3311 Toledo Road - Metro IV- Suite 2427
Hyattsville, MD 20782
Tel. 301.458.4634
Fax. 301.458.4043
Email: JAlbertorio@cdc.gov