« Busy Busy Busy | Main | Dynamist housing bubble »

date simulation

Want a list of week-ending dates simulated, starting
at 2005 March 28 and ending at 2005 Nov 21.

Find magic number 16515 by trial and error,
or a SAS date function.

Find magic nbumber 250 by trial and error,
or a SAS date function.

data plan;
datebase = 16515;
do i = 1 to 250 by 7;
datex = datebase + i;
week = round (1+i/7);
output;
end;
format datex mmddyy10.;
run;
proc print data = plan; var datex week; run;

More SAS date dox.

Obs datex week

1 03/21/2005 1
2 03/28/2005 2
3 04/04/2005 3
4 04/11/2005 4
5 04/18/2005 5
6 04/25/2005 6
7 05/02/2005 7
8 05/09/2005 8
9 05/16/2005 9
10 05/23/2005 10
11 05/30/2005 11
12 06/06/2005 12
13 06/13/2005 13
14 06/20/2005 14
15 06/27/2005 15
16 07/04/2005 16
17 07/11/2005 17
18 07/18/2005 18
19 07/25/2005 19
20 08/01/2005 20
21 08/08/2005 21
22 08/15/2005 22
23 08/22/2005 23
24 08/29/2005 24
25 09/05/2005 25
26 09/12/2005 26
27 09/19/2005 27
28 09/26/2005 28
29 10/03/2005 29
30 10/10/2005 30
31 10/17/2005 31
32 10/24/2005 32
33 10/31/2005 33
34 11/07/2005 34
35 11/14/2005 35
36 11/21/2005 36

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)