Note that the OP asked for "1(Monday) 2(Tuesday)", etc. A slight
modification to Art's code will achieve that. E.g.,
data list list/mydate(adate10).
begin data
1/12/2015
1/13/2015
1/14/2015
1/15/2015
1/16/2015
1/17/2015
1/18/2015
1/19/2015
end data.
numeric DayOfWeek(f1).
***************************************** .
compute DayOfWeek = xdate.wkday(mydate)-1.
recode DayOfWeek (0 = 7).
***************************************** .
value labels DayOfWeek
1 'Monday'
2 'Tuesday'
3 'Wednesday'
4 'Thursday'
5 'Friday'
6 'Saturday'
7 'Sunday'.
list.
OUTPUT:
mydate DayOfWeek
01/12/2015 1
01/13/2015 2
01/14/2015 3
01/15/2015 4
01/16/2015 5
01/17/2015 6
01/18/2015 7
01/19/2015 1
Number of cases read: 8 Number of cases listed: 8
--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/Home
"When all else fails, RTFM."