1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
*(Q) I have a date variable but would like to display the date in the format
	ddd dd-mmm-yyyy format, where ddd is the first 3 letters of the day of the week.

*(A) Posted to spss newsgroup on 2003/03/24 by Raynald Levesque.

DATA LIST LIST /date1 (ADATE10).
BEGIN DATA
03/24/2003
END DATA.

FORMATS date1 (DATE11).
COMPUTE dweek=XDATE.WKDAY(date1).
STRING dayname(A21) date2(A40).
COMPUTE dayname="SunMonTueWedThuFriSat".
COMPUTE date2=CONCAT(SUBSTR(dayname,1+ (dweek-1)*3,3)," ",STRING(date1,DATE12)).
LIST date2.

* The result of LIST is:
DATE2

Mon 24-MAR-2003