version	U12.1.00
uid	datecomp.u1-1787877008-0
impl	error
global	10
	0,000005,dgt,2
	1,000005,dlt,2
	2,000005,deq,2
	3,000005,futuredate,1
	4,000005,pastdate,1
	5,000005,betweendates,3
	6,000005,reformatdate,1
	7,000005,getmonth,1
	8,000005,getday,1
	9,000005,getyear,1

proc dgt
	local	0,001000,date1
	local	1,001000,date2
	local	2,000000,reformatdate
	local	3,000000,integer
	local	4,000000,right
	local	5,000000,left
	local	6,000000,getmonth
	con	0,002000,1,4
	con	1,002000,1,2
	declend
	filen	datecomp.icn
	line	56
	colm	11
	synt	any
	mark	L1
	pnull
	var	0
	var	2
	var	0
	line	59
	colm	25
	synt	any
	invoke	1
	line	59
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	2
	var	1
	line	60
	colm	25
	synt	any
	invoke	1
	line	60
	colm	10
	synt	any
	asgn
	unmark
lab L2
	mark	L3
	line	63
	colm	4
	synt	ifelse
	mark	L4
	pnull
	var	3
	var	4
	var	0
	int	0
	line	63
	colm	21
	synt	any
	invoke	2
	line	63
	colm	15
	synt	any
	invoke	1
	var	3
	var	4
	var	1
	int	0
	line	63
	colm	48
	synt	any
	invoke	2
	line	63
	colm	42
	synt	any
	invoke	1
	line	63
	colm	33
	synt	any
	numgt
	unmark
	mark	L6
	pnull
	line	64
	colm	7
	synt	any
	pret
lab L6
	synt	any
	pfail
	goto	L5
lab L4
	line	67
	colm	7
	synt	if
	mark0
	pnull
	var	3
	var	4
	var	1
	int	0
	line	67
	colm	23
	synt	any
	invoke	2
	line	67
	colm	17
	synt	any
	invoke	1
	var	3
	var	4
	var	0
	int	0
	line	67
	colm	50
	synt	any
	invoke	2
	line	67
	colm	44
	synt	any
	invoke	1
	line	67
	colm	35
	synt	any
	numgt
	unmark
	line	68
	colm	10
	synt	any
	pfail
	line	67
	colm	7
	synt	endif
lab L5
	line	63
	colm	4
	synt	endifelse
	unmark
lab L3
	mark	L7
	line	72
	colm	4
	synt	ifelse
	mark	L8
	pnull
	var	3
	var	5
	var	0
	int	1
	line	72
	colm	20
	synt	any
	invoke	2
	line	72
	colm	15
	synt	any
	invoke	1
	var	3
	var	5
	var	1
	int	1
	line	72
	colm	46
	synt	any
	invoke	2
	line	72
	colm	41
	synt	any
	invoke	1
	line	72
	colm	32
	synt	any
	numgt
	unmark
	mark	L10
	pnull
	line	73
	colm	7
	synt	any
	pret
lab L10
	synt	any
	pfail
	goto	L9
lab L8
	line	76
	colm	7
	synt	if
	mark0
	pnull
	var	3
	var	5
	var	1
	int	1
	line	76
	colm	22
	synt	any
	invoke	2
	line	76
	colm	17
	synt	any
	invoke	1
	var	3
	var	5
	var	0
	int	1
	line	76
	colm	48
	synt	any
	invoke	2
	line	76
	colm	43
	synt	any
	invoke	1
	line	76
	colm	34
	synt	any
	numgt
	unmark
	line	77
	colm	10
	synt	any
	pfail
	line	76
	colm	7
	synt	endif
lab L9
	line	72
	colm	4
	synt	endifelse
	unmark
lab L7
	mark	L11
	line	86
	colm	4
	synt	ifelse
	mark	L12
	pnull
	var	3
	var	6
	var	0
	line	86
	colm	24
	synt	any
	invoke	1
	line	86
	colm	15
	synt	any
	invoke	1
	var	3
	var	6
	var	1
	line	86
	colm	51
	synt	any
	invoke	1
	line	86
	colm	42
	synt	any
	invoke	1
	line	86
	colm	33
	synt	any
	numgt
	unmark
	mark	L14
	pnull
	line	87
	colm	7
	synt	any
	pret
lab L14
	synt	any
	pfail
	goto	L13
lab L12
	line	90
	colm	7
	synt	if
	mark0
	pnull
	var	3
	var	6
	var	1
	line	90
	colm	26
	synt	any
	invoke	1
	line	90
	colm	17
	synt	any
	invoke	1
	var	3
	var	6
	var	0
	line	90
	colm	53
	synt	any
	invoke	1
	line	90
	colm	44
	synt	any
	invoke	1
	line	90
	colm	35
	synt	any
	numgt
	unmark
	line	91
	colm	10
	synt	any
	pfail
	line	90
	colm	7
	synt	endif
lab L13
	line	86
	colm	4
	synt	endifelse
	unmark
lab L11
	pnull
	line	95
	colm	1
	synt	any
	pfail
	end
proc dlt
	local	0,001000,date1
	local	1,001000,date2
	local	2,000000,dgt
	declend
	line	100
	colm	11
	synt	any
	mark	L1
	mark	L2
	var	2
	var	1
	var	0
	line	102
	colm	14
	synt	any
	invoke	2
	line	102
	colm	4
	synt	any
	pret
lab L2
	synt	any
	pfail
	unmark
lab L1
	pnull
	line	104
	colm	1
	synt	any
	pfail
	end
proc deq
	local	0,001000,date1
	local	1,001000,date2
	local	2,000000,reformatdate
	declend
	line	108
	colm	11
	synt	any
	mark	L1
	pnull
	var	0
	var	2
	var	0
	line	110
	colm	25
	synt	any
	invoke	1
	line	110
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	2
	var	1
	line	111
	colm	25
	synt	any
	invoke	1
	line	111
	colm	10
	synt	any
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	pnull
	var	0
	var	1
	line	112
	colm	17
	synt	any
	lexeq
	line	112
	colm	4
	synt	any
	pret
lab L4
	synt	any
	pfail
	unmark
lab L3
	pnull
	line	113
	colm	1
	synt	any
	pfail
	end
proc futuredate
	local	0,001000,date1
	local	1,000000,dgt
	declend
	line	117
	colm	11
	synt	any
	mark	L1
	mark	L2
	var	1
	var	0
	line	119
	colm	22
	synt	any
	keywd	date
	line	119
	colm	14
	synt	any
	invoke	2
	line	119
	colm	4
	synt	any
	pret
lab L2
	synt	any
	pfail
	unmark
lab L1
	pnull
	line	121
	colm	1
	synt	any
	pfail
	end
proc pastdate
	local	0,001000,date1
	local	1,000000,dgt
	declend
	line	124
	colm	11
	synt	any
	mark	L1
	mark	L2
	var	1
	line	126
	colm	15
	synt	any
	keywd	date
	var	0
	line	126
	colm	14
	synt	any
	invoke	2
	line	126
	colm	4
	synt	any
	pret
lab L2
	synt	any
	pfail
	unmark
lab L1
	pnull
	line	128
	colm	1
	synt	any
	pfail
	end
proc betweendates
	local	0,001000,date1
	local	1,001000,date2
	local	2,001000,date3
	local	3,000000,dlt
	local	4,000000,dgt
	declend
	line	137
	colm	11
	synt	any
	mark	L1
	line	138
	colm	4
	synt	if
	mark0
	var	3
	var	2
	var	1
	line	138
	colm	10
	synt	any
	invoke	2
	unmark
	line	138
	colm	30
	synt	any
	pfail
	line	138
	colm	4
	synt	endif
	unmark
lab L1
	mark	L2
	line	139
	colm	4
	synt	if
	mark0
	var	3
	var	0
	var	1
	line	139
	colm	10
	synt	any
	invoke	2
	unmark
	line	139
	colm	30
	synt	any
	pfail
	line	139
	colm	4
	synt	endif
	unmark
lab L2
	mark	L3
	line	140
	colm	4
	synt	if
	mark0
	var	4
	var	0
	var	2
	line	140
	colm	10
	synt	any
	invoke	2
	unmark
	line	140
	colm	30
	synt	any
	pfail
	line	140
	colm	4
	synt	endif
	unmark
lab L3
	mark	L4
	mark	L5
	pnull
	line	141
	colm	4
	synt	any
	pret
lab L5
	synt	any
	pfail
	unmark
lab L4
	pnull
	line	142
	colm	1
	synt	any
	pfail
	end
proc reformatdate
	local	0,001000,thisdate
	local	1,000000,str
	local	2,000000,tab
	local	3,000000,find
	local	4,000000,move
	local	5,000000,getmonth
	local	6,000000,getday
	local	7,000000,getyear
	con	0,010000,1,057
	con	1,002000,1,8
	con	2,002000,1,4
	con	3,002000,1,2
	con	4,002000,1,1
	con	5,010000,0
	declend
	line	151
	colm	11
	synt	any
	mark	L1
	var	0
	line	153
	colm	13
	synt	any
	bscan
	mark	L2
	pnull
	var	1
	var	2
	var	3
	str	0
	line	154
	colm	22
	synt	any
	invoke	1
	line	154
	colm	17
	synt	any
	invoke	1
	line	154
	colm	11
	synt	any
	asgn
	unmark
lab L2
	line	155
	colm	7
	synt	if
	mark0
	pnull
	var	1
	line	155
	colm	11
	synt	any
	null
	pop
	pnull
	int	1
	pnull
	var	0
	line	155
	colm	23
	synt	any
	size
	line	155
	colm	21
	synt	any
	numeq
	unmark
	mark	L3
	var	4
	int	2
	line	156
	colm	14
	synt	any
	invoke	1
	unmark
lab L3
	mark	L4
	pnull
	var	1
	pnull
	pnull
	var	4
	int	3
	line	157
	colm	21
	synt	any
	invoke	1
	str	0
	line	157
	colm	25
	synt	any
	cat
	var	4
	int	3
	line	157
	colm	39
	synt	any
	invoke	1
	line	157
	colm	32
	synt	any
	cat
	line	157
	colm	14
	synt	any
	asgn
	unmark
lab L4
	mark	L5
	var	2
	int	4
	line	158
	colm	13
	synt	any
	invoke	1
	unmark
lab L5
	mark	L6
	pnull
	var	1
	pnull
	pnull
	var	1
	str	0
	line	159
	colm	21
	synt	any
	cat
	var	4
	int	2
	line	159
	colm	35
	synt	any
	invoke	1
	line	159
	colm	28
	synt	any
	cat
	line	159
	colm	14
	synt	any
	asgn
	unmark
lab L6
	mark	L7
	var	1
	line	160
	colm	10
	synt	any
	pret
lab L7
	synt	any
	pfail
	line	155
	colm	7
	synt	endif
	line	153
	colm	13
	synt	any
	escan
	unmark
lab L1
	mark	L8
	pnull
	var	1
	str	5
	line	163
	colm	8
	synt	any
	asgn
	unmark
lab L8
	mark	L9
	var	0
	line	165
	colm	13
	synt	any
	bscan
	mark	L10
	pnull
	var	1
	var	2
	var	3
	str	0
	line	166
	colm	22
	synt	any
	invoke	1
	line	166
	colm	17
	synt	any
	invoke	1
	line	166
	colm	11
	synt	any
	asgn
	unmark
lab L10
	line	167
	colm	7
	synt	ifelse
	mark	L11
	pnull
	pnull
	var	1
	line	167
	colm	11
	synt	any
	size
	int	3
	line	167
	colm	16
	synt	any
	numgt
	unmark
	mark	L13
	pnull
	pnull
	pnull
	pnull
	var	5
	var	0
	line	169
	colm	26
	synt	any
	invoke	1
	str	0
	line	169
	colm	37
	synt	any
	cat
	var	6
	var	0
	line	169
	colm	53
	synt	any
	invoke	1
	line	169
	colm	44
	synt	any
	cat
	str	0
	line	169
	colm	64
	synt	any
	cat
	var	7
	var	0
	line	169
	colm	81
	synt	any
	invoke	1
	line	169
	colm	71
	synt	any
	cat
	line	169
	colm	10
	synt	any
	pret
lab L13
	synt	any
	pfail
	goto	L12
lab L11
	mark	L14
	var	0
	line	172
	colm	10
	synt	any
	pret
lab L14
	synt	any
	pfail
lab L12
	line	167
	colm	7
	synt	endifelse
	line	165
	colm	13
	synt	any
	escan
	unmark
lab L9
	pnull
	line	174
	colm	1
	synt	any
	pfail
	end
proc getmonth
	local	0,001000,thisdate
	local	1,000000,thismonth
	local	2,000000,tab
	local	3,000000,find
	con	0,010000,1,057
	declend
	line	184
	colm	11
	synt	any
	mark	L1
	var	0
	line	186
	colm	13
	synt	any
	bscan
	mark	L2
	pnull
	var	1
	var	2
	var	3
	str	0
	line	187
	colm	28
	synt	any
	invoke	1
	line	187
	colm	23
	synt	any
	invoke	1
	line	187
	colm	17
	synt	any
	asgn
	unmark
lab L2
	mark	L3
	pnull
	str	0
	line	188
	colm	7
	synt	any
	tabmat
	unmark
lab L3
	mark	L4
	pnull
	var	1
	var	2
	var	3
	str	0
	line	189
	colm	28
	synt	any
	invoke	1
	line	189
	colm	23
	synt	any
	invoke	1
	line	189
	colm	17
	synt	any
	asgn
	unmark
lab L4
	mark	L5
	pnull
	str	0
	line	190
	colm	7
	synt	any
	tabmat
	unmark
lab L5
	mark	L6
	var	1
	line	191
	colm	7
	synt	any
	pret
lab L6
	synt	any
	pfail
	line	186
	colm	13
	synt	any
	escan
	unmark
lab L1
	pnull
	line	193
	colm	1
	synt	any
	pfail
	end
proc getday
	local	0,001000,thisdate
	local	1,000000,right
	con	0,002000,1,2
	declend
	line	195
	colm	11
	synt	any
	mark	L1
	mark	L2
	var	1
	var	0
	int	0
	line	197
	colm	16
	synt	any
	invoke	2
	line	197
	colm	4
	synt	any
	pret
lab L2
	synt	any
	pfail
	unmark
lab L1
	pnull
	line	198
	colm	1
	synt	any
	pfail
	end
proc getyear
	local	0,001000,thisdate
	local	1,000000,left
	con	0,002000,1,4
	declend
	line	200
	colm	11
	synt	any
	mark	L1
	mark	L2
	var	1
	var	0
	int	0
	line	202
	colm	15
	synt	any
	invoke	2
	line	202
	colm	4
	synt	any
	pret
lab L2
	synt	any
	pfail
	unmark
lab L1
	pnull
	line	203
	colm	1
	synt	any
	pfail
	end
