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 (September 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 15 Sep 2005 13:47:15 -0400
Reply-To:     Richard Ristow <wrristow@mindspring.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Richard Ristow <wrristow@mindspring.com>
Subject:      Re: converting a missing time value into a real time value
Comments: To: Martin Sherman <MSherman@loyola.edu>
In-Reply-To:  <s3295062.047@GWMAIL01.LOYOLA.EDU>
Content-Type: text/plain; charset="us-ascii"; format=flowed

At 10:43 AM 9/15/2005, Martin Sherman wrote:

>Dear list, I have a time variable (HH.MM.SS) where a subject has it >missing (just a dot in the data field). I want to change it to 9:00. > >I have tried the following but it doesn't work. > >if q1 eq 52724937 @55time_ eq 9:00.

I have no idea where the 52724937 comes from. I'd have thought (as Hector Maletta suggested) that the (entered) dot (entered) would give you value SYSMIS.

In any case, though, there's no constant to represent time 9:00. Instead, use use a time function. "9:00" can be written quite easily as TIME.HMS(9). (See documentation on TIME.HMS, which is a very versatile function.)

Demonstration below:

* C:\C_Ad_Hoc\spssx-l\Z-2005b\ . * 2005-09-15 Sherman - converting a missing time value.SPS.

* In response to posting * Date Thu, 15 Sep 2005 104323 -0400 * From Martin Sherman <MSherman@loyola.edu> . * Subject converting a missing time value . * into a real time value. .

INPUT PROGRAM. . NUMERIC INTEGER (COMMA11). . COMPUTE INTEGER = 52724937. . END CASE. END FILE. END INPUT PROGRAM.

NUMERIC TIME (TIME8) /DATETIME (DATETIME17). COMPUTE TIME = INTEGER. COMPUTE DATETIME = INTEGER.

NUMERIC MSNGTIME @55btime (TIME8). COMPUTE MSNGTIME = $SYSMIS.

IF MISSING(MSNGTIME) @55btime = TIME.HMS(9). NUMERIC @55B_INT (COMMA11). COMPUTE @55B_INT = @55BTIME.

LIST. List Notes |---------------------------|--------------------------| |Output Created |15 Sep 05 13:44:12 | |---------------------------|--------------------------|

INTEGER TIME DATETIME MSNGTIME @55BTIME @55B_INT

52,724,937 14645:48 15-JUN-1584 05:48 . 9:00:00 32,400

Number of cases read: 1 Number of cases listed: 1


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