proc initdate
	filen	datefns.icn
	local	0,000000,monthlist
	local	1,000000,monthtbl
	local	2,000000,table
	local	3,000000,dow
	local	4,000000,cum_days
	con	0,010000,7,112,141,156,165,141,162,171
	con	1,010000,8,106,145,142,162,165,141,162,171
	con	2,010000,5,115,141,162,143,150
	con	3,010000,5,101,160,162,151,154
	con	4,010000,3,115,141,171
	con	5,010000,4,112,165,156,145
	con	6,010000,4,112,165,154,171
	con	7,010000,6,101,165,147,165,163,164
	con	8,010000,9,123,145,160,164,145,155,142,145,162
	con	9,010000,7,117,143,164,157,142,145,162
	con	10,010000,8,116,157,166,145,155,142,145,162
	con	11,010000,8,104,145,143,145,155,142,145,162
	con	12,002000,1,1
	con	13,002000,1,2
	con	14,002000,1,3
	con	15,002000,1,4
	con	16,002000,1,5
	con	17,002000,1,6
	con	18,002000,1,7
	con	19,002000,1,8
	con	20,002000,1,9
	con	21,002000,2,10
	con	22,002000,2,11
	con	23,002000,2,12
	con	24,010000,6,123,165,156,144,141,171
	con	25,010000,6,115,157,156,144,141,171
	con	26,010000,7,124,165,145,163,144,141,171
	con	27,010000,9,127,145,144,156,145,163,144,141,171
	con	28,010000,8,124,150,165,162,163,144,141,171
	con	29,010000,6,106,162,151,144,141,171
	con	30,010000,8,123,141,164,165,162,144,141,171
	con	31,002000,1,0
	con	32,002000,2,31
	con	33,002000,2,59
	con	34,002000,2,90
	con	35,002000,3,120
	con	36,002000,3,151
	con	37,002000,3,181
	con	38,002000,3,212
	con	39,002000,3,243
	con	40,002000,3,273
	con	41,002000,3,304
	con	42,002000,3,334
	con	43,002000,3,365
	con	44,002000,2,60
	con	45,002000,2,91
	con	46,002000,3,121
	con	47,002000,3,152
	con	48,002000,3,182
	con	49,002000,3,213
	con	50,002000,3,244
	con	51,002000,3,274
	con	52,002000,3,305
	con	53,002000,3,335
	con	54,002000,3,366
	declend
	line	45
	colm	11
	mark	L1
	pnull
	var	0
	pnull
	str	0
	str	1
	str	2
	str	3
	str	4
	str	5
	str	6
	str	7
	str	8
	str	9
	str	10
	str	11
	line	47
	colm	7
	llist	12
	line	46
	colm	14
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	2
	line	51
	colm	24
	invoke	0
	line	51
	colm	16
	asgn
	unmark
lab L2
	mark	L3
	pnull
	pnull
	var	1
	str	0
	line	52
	colm	15
	subsc
	int	12
	line	52
	colm	29
	asgn
	unmark
lab L3
	mark	L4
	pnull
	pnull
	var	1
	str	1
	line	53
	colm	15
	subsc
	int	13
	line	53
	colm	29
	asgn
	unmark
lab L4
	mark	L5
	pnull
	pnull
	var	1
	str	2
	line	54
	colm	15
	subsc
	int	14
	line	54
	colm	29
	asgn
	unmark
lab L5
	mark	L6
	pnull
	pnull
	var	1
	str	3
	line	55
	colm	15
	subsc
	int	15
	line	55
	colm	29
	asgn
	unmark
lab L6
	mark	L7
	pnull
	pnull
	var	1
	str	4
	line	56
	colm	15
	subsc
	int	16
	line	56
	colm	29
	asgn
	unmark
lab L7
	mark	L8
	pnull
	pnull
	var	1
	str	5
	line	57
	colm	15
	subsc
	int	17
	line	57
	colm	29
	asgn
	unmark
lab L8
	mark	L9
	pnull
	pnull
	var	1
	str	6
	line	58
	colm	15
	subsc
	int	18
	line	58
	colm	29
	asgn
	unmark
lab L9
	mark	L10
	pnull
	pnull
	var	1
	str	7
	line	59
	colm	15
	subsc
	int	19
	line	59
	colm	29
	asgn
	unmark
lab L10
	mark	L11
	pnull
	pnull
	var	1
	str	8
	line	60
	colm	15
	subsc
	int	20
	line	60
	colm	29
	asgn
	unmark
lab L11
	mark	L12
	pnull
	pnull
	var	1
	str	9
	line	61
	colm	15
	subsc
	int	21
	line	61
	colm	29
	asgn
	unmark
lab L12
	mark	L13
	pnull
	pnull
	var	1
	str	10
	line	62
	colm	15
	subsc
	int	22
	line	62
	colm	29
	asgn
	unmark
lab L13
	mark	L14
	pnull
	pnull
	var	1
	str	11
	line	63
	colm	15
	subsc
	int	23
	line	63
	colm	29
	asgn
	unmark
lab L14
	mark	L15
	pnull
	var	3
	pnull
	str	24
	str	25
	str	26
	str	27
	str	28
	str	29
	str	30
	line	66
	colm	7
	llist	7
	line	65
	colm	8
	asgn
	unmark
lab L15
	mark	L16
	pnull
	var	4
	pnull
	pnull
	int	31
	int	32
	int	33
	int	34
	int	35
	int	36
	int	37
	int	38
	int	39
	int	40
	int	41
	int	42
	int	43
	line	69
	colm	7
	llist	13
	pnull
	int	31
	int	32
	int	44
	int	45
	int	46
	int	47
	int	48
	int	49
	int	50
	int	51
	int	52
	int	53
	int	54
	line	70
	colm	7
	llist	13
	line	68
	colm	16
	llist	2
	line	68
	colm	13
	asgn
	unmark
lab L16
	mark	L17
	mark	L18
	pnull
	line	72
	colm	4
	pret
lab L18
	pfail
	unmark
lab L17
	pnull
	line	73
	colm	1
	pfail
	end
proc today
	local	0,000020,junk
	local	1,000020,datestruct
	local	2,000000,date_rec
	local	3,000000,tab
	local	4,000000,upto
	local	5,000000,many
	local	6,000000,monthtbl
	local	7,000000,doy
	declend
	line	76
	colm	11
	mark	L1
	pnull
	var	1
	var	2
	line	79
	colm	26
	invoke	0
	line	79
	colm	15
	asgn
	unmark
lab L1
	mark	L2
	line	80
	colm	4
	keywd	dateline
	line	80
	colm	14
	bscan
	mark	L3
	pnull
	var	0
	var	3
	var	4
	line	81
	colm	24
	keywd	letters
	line	81
	colm	23
	invoke	1
	line	81
	colm	18
	invoke	1
	line	81
	colm	12
	asgn
	unmark
lab L3
	mark	L4
	pnull
	pnull
	var	1
	line	82
	colm	17
	field	dayname
	var	3
	var	5
	line	82
	colm	38
	keywd	letters
	line	82
	colm	37
	invoke	1
	line	82
	colm	32
	invoke	1
	line	82
	colm	26
	asgn
	unmark
lab L4
	mark	L5
	pnull
	var	0
	var	3
	var	4
	line	83
	colm	24
	keywd	letters
	line	83
	colm	23
	invoke	1
	line	83
	colm	18
	invoke	1
	line	83
	colm	12
	asgn
	unmark
lab L5
	mark	L6
	pnull
	pnull
	var	1
	line	84
	colm	17
	field	monthname
	var	3
	var	5
	line	84
	colm	40
	keywd	letters
	line	84
	colm	39
	invoke	1
	line	84
	colm	34
	invoke	1
	line	84
	colm	28
	asgn
	unmark
lab L6
	mark	L7
	pnull
	var	0
	var	3
	var	4
	line	85
	colm	24
	keywd	digits
	line	85
	colm	23
	invoke	1
	line	85
	colm	18
	invoke	1
	line	85
	colm	12
	asgn
	unmark
lab L7
	mark	L8
	pnull
	pnull
	var	1
	line	86
	colm	17
	field	day
	var	3
	var	5
	line	86
	colm	34
	keywd	digits
	line	86
	colm	33
	invoke	1
	line	86
	colm	28
	invoke	1
	line	86
	colm	22
	asgn
	unmark
lab L8
	mark	L9
	pnull
	var	0
	var	3
	var	4
	line	87
	colm	24
	keywd	digits
	line	87
	colm	23
	invoke	1
	line	87
	colm	18
	invoke	1
	line	87
	colm	12
	asgn
	unmark
lab L9
	pnull
	pnull
	var	1
	line	88
	colm	17
	field	year
	var	3
	var	5
	line	88
	colm	35
	keywd	digits
	line	88
	colm	34
	invoke	1
	line	88
	colm	29
	invoke	1
	line	88
	colm	23
	asgn
	line	80
	colm	14
	escan
	unmark
lab L2
	mark	L10
	pnull
	pnull
	var	1
	line	91
	colm	14
	field	month
	pnull
	var	6
	pnull
	var	1
	line	91
	colm	43
	field	monthname
	line	91
	colm	32
	subsc
	line	91
	colm	21
	asgn
	unmark
lab L10
	mark	L11
	pnull
	pnull
	var	1
	line	92
	colm	14
	field	yearday
	var	7
	pnull
	var	1
	line	92
	colm	40
	field	year
	pnull
	var	1
	line	92
	colm	57
	field	month
	pnull
	var	1
	line	92
	colm	75
	field	day
	line	92
	colm	29
	invoke	3
	line	92
	colm	23
	asgn
	unmark
lab L11
	mark	L12
	mark	L13
	var	1
	line	93
	colm	4
	pret
lab L13
	pfail
	unmark
lab L12
	pnull
	line	94
	colm	1
	pfail
	end
proc julian
	local	0,001000,date
	local	1,000020,jul
	local	2,000020,ja
	local	3,000020,jy
	local	4,000020,jm
	local	5,000020,z1
	local	6,000020,z2
	local	7,000000,real
	local	8,000000,integer
	con	0,002000,1,0
	con	1,002000,1,1
	con	2,002000,1,2
	con	3,002000,2,13
	con	4,004000,365.25
	con	5,004000,30.6001
	con	6,002000,7,1720995
	con	7,002000,2,31
	con	8,002000,2,12
	con	9,002000,6,588829
	con	10,004000,0.01
	con	11,004000,0.25
	declend
	line	114
	colm	11
	mark	L1
	mark0
	pnull
	pnull
	var	0
	line	119
	colm	11
	field	year
	int	0
	line	119
	colm	17
	numeq
	unmark
	line	120
	colm	7
	pfail
	unmark
lab L1
	mark	L2
	mark0
	pnull
	pnull
	var	0
	line	121
	colm	11
	field	year
	int	0
	line	121
	colm	17
	numlt
	unmark
	pnull
	pnull
	var	0
	line	122
	colm	11
	field	year
	dup
	int	1
	line	122
	colm	17
	plus
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	pnull
	pnull
	var	0
	line	123
	colm	11
	field	month
	int	2
	line	123
	colm	18
	numgt
	unmark
	mark	L6
	pnull
	var	3
	pnull
	var	0
	line	124
	colm	17
	field	year
	line	124
	colm	10
	asgn
	unmark
lab L6
	pnull
	var	4
	pnull
	pnull
	var	0
	line	125
	colm	17
	field	month
	int	1
	line	125
	colm	24
	plus
	line	125
	colm	10
	asgn
	goto	L5
lab L4
	mark	L7
	pnull
	var	3
	pnull
	pnull
	var	0
	line	127
	colm	17
	field	year
	int	1
	line	127
	colm	23
	minus
	line	127
	colm	10
	asgn
	unmark
lab L7
	pnull
	var	4
	pnull
	pnull
	var	0
	line	128
	colm	17
	field	month
	int	3
	line	128
	colm	24
	plus
	line	128
	colm	10
	asgn
lab L5
	unmark
lab L3
	mark	L8
	pnull
	var	5
	var	7
	var	8
	pnull
	real	4
	var	3
	line	131
	colm	29
	mult
	line	131
	colm	22
	invoke	1
	line	131
	colm	14
	invoke	1
	line	131
	colm	7
	asgn
	unmark
lab L8
	mark	L9
	pnull
	var	6
	var	7
	var	8
	pnull
	real	5
	var	4
	line	132
	colm	30
	mult
	line	132
	colm	22
	invoke	1
	line	132
	colm	14
	invoke	1
	line	132
	colm	7
	asgn
	unmark
lab L9
	mark	L10
	pnull
	var	1
	var	8
	pnull
	pnull
	pnull
	var	5
	var	6
	line	133
	colm	22
	plus
	pnull
	var	0
	line	133
	colm	33
	field	day
	line	133
	colm	27
	plus
	int	6
	line	133
	colm	38
	plus
	line	133
	colm	18
	invoke	1
	line	133
	colm	8
	asgn
	unmark
lab L10
	mark	L11
	mark0
	pnull
	pnull
	pnull
	var	0
	line	134
	colm	11
	field	day
	pnull
	int	7
	pnull
	pnull
	var	0
	line	134
	colm	26
	field	month
	pnull
	int	8
	pnull
	var	0
	line	134
	colm	42
	field	year
	line	134
	colm	37
	mult
	line	134
	colm	33
	plus
	line	134
	colm	20
	mult
	line	134
	colm	16
	plus
	int	9
	line	134
	colm	49
	numge
	unmark
	mark	L12
	pnull
	var	2
	var	8
	pnull
	real	10
	var	3
	line	135
	colm	25
	mult
	line	135
	colm	20
	invoke	1
	line	135
	colm	10
	asgn
	unmark
lab L12
	pnull
	var	1
	dup
	pnull
	pnull
	int	2
	var	2
	line	136
	colm	17
	minus
	var	8
	pnull
	real	11
	var	2
	line	136
	colm	36
	mult
	line	136
	colm	31
	invoke	1
	line	136
	colm	22
	plus
	line	136
	colm	11
	plus
	asgn
	unmark
lab L11
	mark	L13
	mark	L14
	var	1
	line	138
	colm	4
	pret
lab L14
	pfail
	unmark
lab L13
	pnull
	line	140
	colm	1
	pfail
	end
proc unjulian
	local	0,001000,julianday
	local	1,000020,ja
	local	2,000020,jalpha
	local	3,000020,jb
	local	4,000020,jc
	local	5,000020,jd
	local	6,000020,je
	local	7,000020,datestruct
	local	8,000000,date_rec
	local	9,000000,integer
	local	10,000000,real
	local	11,000000,doy
	local	12,000000,monthlist
	local	13,000000,dow
	con	0,002000,7,2299161
	con	1,002000,7,1867216
	con	2,004000,0.25
	con	3,004000,36524.25
	con	4,002000,1,1
	con	5,002000,4,1524
	con	6,004000,6680.0
	con	7,002000,7,2439870
	con	8,004000,122.1
	con	9,004000,365.25
	con	10,002000,3,365
	con	11,004000,30.6001
	con	12,002000,2,12
	con	13,002000,4,4715
	con	14,002000,1,2
	con	15,002000,1,0
	con	16,002000,1,7
	declend
	line	143
	colm	11
	mark	L1
	pnull
	var	7
	var	8
	line	148
	colm	26
	invoke	0
	line	148
	colm	15
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	pnull
	var	0
	int	0
	line	149
	colm	17
	numge
	unmark
	mark	L5
	pnull
	var	2
	var	9
	pnull
	pnull
	var	10
	pnull
	var	0
	int	1
	line	150
	colm	41
	minus
	line	150
	colm	30
	invoke	1
	real	2
	line	150
	colm	52
	minus
	real	3
	line	150
	colm	59
	div
	line	150
	colm	24
	invoke	1
	line	150
	colm	14
	asgn
	unmark
lab L5
	pnull
	var	1
	pnull
	pnull
	pnull
	var	0
	int	4
	line	151
	colm	23
	plus
	var	2
	line	151
	colm	27
	plus
	var	9
	pnull
	real	2
	var	2
	line	151
	colm	50
	mult
	line	151
	colm	45
	invoke	1
	line	151
	colm	36
	minus
	line	151
	colm	10
	asgn
	goto	L4
lab L3
	pnull
	var	1
	var	0
	line	153
	colm	10
	asgn
lab L4
	unmark
lab L2
	mark	L6
	pnull
	var	3
	pnull
	var	1
	int	5
	line	154
	colm	13
	plus
	line	154
	colm	7
	asgn
	unmark
lab L6
	mark	L7
	pnull
	var	4
	var	9
	pnull
	real	6
	pnull
	pnull
	var	10
	pnull
	var	3
	int	7
	line	155
	colm	36
	minus
	line	155
	colm	32
	invoke	1
	real	8
	line	155
	colm	47
	minus
	real	9
	line	155
	colm	55
	div
	line	155
	colm	25
	plus
	line	155
	colm	17
	invoke	1
	line	155
	colm	7
	asgn
	unmark
lab L7
	mark	L8
	pnull
	var	5
	pnull
	pnull
	int	10
	var	4
	line	156
	colm	13
	mult
	var	9
	pnull
	real	2
	var	4
	line	156
	colm	31
	mult
	line	156
	colm	26
	invoke	1
	line	156
	colm	17
	plus
	line	156
	colm	7
	asgn
	unmark
lab L8
	mark	L9
	pnull
	var	6
	var	9
	pnull
	pnull
	var	3
	var	5
	line	157
	colm	22
	minus
	real	11
	line	157
	colm	27
	div
	line	157
	colm	17
	invoke	1
	line	157
	colm	7
	asgn
	unmark
lab L9
	mark	L10
	pnull
	pnull
	var	7
	line	158
	colm	14
	field	day
	pnull
	pnull
	var	3
	var	5
	line	158
	colm	25
	minus
	var	9
	pnull
	real	11
	var	6
	line	158
	colm	47
	mult
	line	158
	colm	39
	invoke	1
	line	158
	colm	30
	minus
	line	158
	colm	19
	asgn
	unmark
lab L10
	mark	L11
	pnull
	pnull
	var	7
	line	159
	colm	14
	field	month
	pnull
	var	6
	int	4
	line	159
	colm	27
	minus
	line	159
	colm	21
	asgn
	unmark
lab L11
	mark	L12
	mark0
	pnull
	pnull
	var	7
	line	160
	colm	17
	field	month
	int	12
	line	160
	colm	24
	numgt
	unmark
	pnull
	pnull
	var	7
	line	161
	colm	17
	field	month
	dup
	int	12
	line	161
	colm	24
	minus
	asgn
	unmark
lab L12
	mark	L13
	pnull
	pnull
	var	7
	line	162
	colm	14
	field	year
	pnull
	var	4
	int	13
	line	162
	colm	26
	minus
	line	162
	colm	20
	asgn
	unmark
lab L13
	mark	L14
	mark0
	pnull
	pnull
	var	7
	line	163
	colm	17
	field	month
	int	14
	line	163
	colm	24
	numgt
	unmark
	pnull
	pnull
	var	7
	line	164
	colm	17
	field	year
	dup
	int	4
	line	164
	colm	23
	minus
	asgn
	unmark
lab L14
	mark	L15
	mark0
	pnull
	pnull
	var	7
	line	165
	colm	17
	field	year
	int	15
	line	165
	colm	23
	numle
	unmark
	pnull
	pnull
	var	7
	line	166
	colm	17
	field	year
	dup
	int	4
	line	166
	colm	23
	minus
	asgn
	unmark
lab L15
	mark	L16
	pnull
	pnull
	var	7
	line	168
	colm	14
	field	yearday
	var	11
	pnull
	var	7
	line	168
	colm	40
	field	year
	pnull
	var	7
	line	168
	colm	57
	field	month
	pnull
	var	7
	line	168
	colm	75
	field	day
	line	168
	colm	29
	invoke	3
	line	168
	colm	23
	asgn
	unmark
lab L16
	mark	L17
	pnull
	pnull
	var	7
	line	170
	colm	14
	field	monthname
	pnull
	var	12
	pnull
	var	7
	line	170
	colm	48
	field	month
	line	170
	colm	37
	subsc
	line	170
	colm	25
	asgn
	unmark
lab L17
	mark	L18
	pnull
	pnull
	var	7
	line	172
	colm	14
	field	dayname
	pnull
	var	13
	pnull
	pnull
	pnull
	var	0
	int	4
	line	172
	colm	41
	plus
	int	16
	line	172
	colm	46
	mod
	int	4
	line	172
	colm	50
	plus
	line	172
	colm	29
	subsc
	line	172
	colm	23
	asgn
	unmark
lab L18
	mark	L19
	mark	L20
	var	7
	line	173
	colm	4
	pret
lab L20
	pfail
	unmark
lab L19
	pnull
	line	175
	colm	1
	pfail
	end
proc doy
	local	0,001000,year
	local	1,001000,month
	local	2,001000,day
	local	3,000020,leap
	local	4,000020,y
	local	5,000020,m
	local	6,000020,d
	local	7,000000,integer
	local	8,000000,cum_days
	con	0,002000,1,4
	con	1,002000,1,0
	con	2,002000,3,100
	con	3,002000,3,400
	con	4,002000,1,2
	con	5,002000,1,1
	declend
	line	179
	colm	11
	mark	L1
	pnull
	var	4
	var	7
	var	0
	line	181
	colm	16
	invoke	1
	line	181
	colm	6
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	5
	var	7
	var	1
	line	182
	colm	16
	invoke	1
	line	182
	colm	6
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	6
	var	7
	var	2
	line	183
	colm	16
	invoke	1
	line	183
	colm	6
	asgn
	unmark
lab L3
	mark	L4
	pnull
	var	3
	mark	L5
	mark	L7
	pnull
	pnull
	var	4
	int	0
	line	185
	colm	13
	mod
	int	1
	line	185
	colm	17
	numeq
	pop
	pnull
	pnull
	var	4
	int	2
	line	185
	colm	25
	mod
	int	1
	line	185
	colm	31
	numne
	esusp
	goto	L8
lab L7
	pnull
	pnull
	var	4
	int	3
	line	185
	colm	41
	mod
	int	1
	line	185
	colm	47
	numeq
lab L8
	unmark
	int	4
	goto	L6
lab L5
	int	5
lab L6
	line	184
	colm	9
	asgn
	unmark
lab L4
	mark	L9
	mark	L10
	pnull
	pnull
	pnull
	var	8
	var	3
	line	189
	colm	19
	subsc
	var	5
	line	189
	colm	25
	subsc
	var	6
	line	189
	colm	29
	plus
	line	189
	colm	4
	pret
lab L10
	pfail
	unmark
lab L9
	pnull
	line	190
	colm	1
	pfail
	end
proc wrdate
	local	0,001000,leadin
	local	1,001000,date
	local	2,000000,write
	con	0,010000,1,040
	declend
	line	193
	colm	11
	mark	L1
	var	2
	var	0
	str	0
	pnull
	var	1
	line	194
	colm	27
	field	year
	str	0
	pnull
	var	1
	line	194
	colm	43
	field	monthname
	str	0
	pnull
	var	1
	line	194
	colm	64
	field	day
	line	194
	colm	9
	invoke	7
	unmark
lab L1
	pnull
	line	195
	colm	1
	pfail
	end
