RosettaCodeData/Task/Five-weekends/Stata/five-weekends.stata

31 lines
418 B
Plaintext

clear
set obs `=tm(2101m1)-tm(1900m1)'
gen month=tm(1900m1)+_n-1
format %tm month
gen day=dofm(month)
keep if dofm(month+1)-day==31 & dow(day)==5
drop day
count
201
list in f/5, noobs noheader
+--------+
| 1901m3 |
| 1902m8 |
| 1903m5 |
| 1904m1 |
| 1904m7 |
+--------+
list in -5/l, noobs noheader
+---------+
| 2097m3 |
| 2098m8 |
| 2099m5 |
| 2100m1 |
| 2100m10 |
+---------+