So, is there a way to insert a 0 after the first slash mark for just
the records which have a single digit date?
Thanks for any help anyone can give me.
Angie
new file.
data list list /id (f3) datestring (A10).
begin data.
1 1/1/2009
2 01/01/2009
3 01/21/2009
4 1/21/2009
end data.
numeric mydate(edate10).
compute mydate = number(datestring,adate10).
LIST .
Art Kendall
Social Research Conultants
Could you post the syntax you generated with the Date & Time Wizard
(DTW)? I'm curious, because the DTW generated code for me (using
v16.02) that worked on Art's little sample file.
new file.
data list list /id (f3) datestring (A10).
begin data.
1 1/1/2009
2 01/01/2009
3 01/21/2009
4 1/21/2009
end data.
* Date and Time Wizard: mydate.
COMPUTE mydate=number(datestring, ADATE10).
VARIABLE LABEL mydate "".
VARIABLE LEVEL mydate (SCALE).
FORMATS mydate (ADATE10).
VARIABLE WIDTH mydate(10).
list.
OUTPUT:
id datestring mydate
1 1/1/2009 01/01/2009
2 01/01/2009 01/01/2009
3 01/21/2009 01/21/2009
4 1/21/2009 01/21/2009
Number of cases read: 4 Number of cases listed: 4
--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."