1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
* (Q) I have a string date without leading zeros. 
	I need a string date with leading zeros.

*(A) Posted to SPSSX-L list by Raynald Levesque 2003/01/09.

DATA LIST LIST /strdate1(A10).
BEGIN DATA
2000/1/1
2001/7/7
2001/8/17
2001/12/17
END DATA.
LIST.

STRING strdate(A10).
COMPUTE strdate=STRING(NUMBER(strdate1,SDATE),ADATE10).
LIST.

* This is the result of the LIST:
STRDATE1   STRDATE

2000/1/1   01/01/2000
2001/7/7   07/07/2001
2001/8/17  08/17/2001
2001/12/17 12/17/2001