LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2001)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 9 May 2001 09:56:24 +1000
Reply-To:     "Hosking, Dianne" <Dianne.Hosking@ACT.GOV.AU>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Hosking, Dianne" <Dianne.Hosking@ACT.GOV.AU>
Subject:      Re: Coverting Birthday Dates
Content-Type: text/plain; charset="ISO-8859-1"

I have a syntax for transforming dates of birth into a string format, as we are required to move data between juristictions in a standard way. NOTE that the format is the English/Australian format (ddmmyyyy) and uses the four-digit date. dateborn = date of birth in any spss date format dob = date of birth as string

*** datefromtxt.sps

*** compute text string from date.

STRING dob (A8).

COMPUTE dob=concat(lpad(ltrim(string(xdate.mday(dateborn),F2)),2,"0"),lpad(ltrim(str ing(xdate.month(dateborn),f2)),2,"0"),string(xdate.year(dateborn),f4)).

EXECUTE.

Dianne Hosking Data Management Unit Health Information Services ACT Department of Health and Community Care

(02) 6207 5405 dianne.hosking@act.gov.au

-----Original Message----- From: Carol Albright [mailto:syzygy@TC.UMN.EDU] Sent: Wednesday, 9 May 2001 1:33 To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: Coverting Birthday Dates

At 08:45 PM 5/7/01 -0400, Harding Faulk wrote:

>>>>

I have coverted student birth dates from (EX: 11/26/66 to 11/26/1966) using the Date function in SPSSPC and a conversion statement: FORMAT birth_da(SDATE11). However, I can't get rid of the slash marks in the converted birthday. Can anyone help me?

<<<<

Why do you need the slash marks removed? Or would you prefer to see your dates in a different format, such as "04-JAN-2001"? All of the "date" formats in SPSS include some kind of punctuation. This will not prevent you from doing calculations, such as # of months from another date.

If you really truly just want the numbers, then you'll need to do a different conversion. Give us a few more details and one of the list can send you the right syntax.

Carol

-------------------------------------------------------------------------

Carol L. Albright, MS | E-Mail : syzygy@tc.umn.edu

Albright Consulting | Phone : 651/699-7218

St. Paul, MN 55105 USA | Research data services

http://www.tc.umn.edu/~syzygy (SPSS tips now on own pages)

-------------------------------------------------------------------------


Back to: Top of message | Previous page | Main SPSSX-L page