pspp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading ddmmyyyy dates


From: John Darrington
Subject: Re: reading ddmmyyyy dates
Date: Mon, 11 May 2009 18:58:13 +0800
User-agent: Mutt/1.5.18 (2008-05-17)

There's no input format that will do what you want.

But one way of reading such data would be as follows:

 data list fixed /day 1-2 month 3-4 year 5-8.
 begin data.
 01042009
 11092001
 end data.

 numeric x (date9).
 compute x=date.dmy(day, month, year).

J'


On Mon, May 11, 2009 at 12:09:42PM +0200, address@hidden wrote:
     
     Hi
     
     to read dates in the form ddmmyyyy (ie with no separator),
     
     I tried
     
     date = number(value, SDATE8)
     
     but this triggers
     
     warning: (SDATE field) Delimiter expected between fields
             in date.
     
     is it possible to read dates with date formats in the nodelimiter case ?
     
     
     otherwise is there a better way than this :
     
     date =
     DATE.DMY( NUMBER( SUBSTR(value,1,2), F2.0), Number( SUBSTR(value,3,2), 
F2.0),
     NUMBER( SUBSTR(value,5,4), F4.0) ).

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]