proc WeightedShuffle
	filen	weighted.icn
	local	0,001000,sample
	local	1,001000,percentage
	local	2,000020,lcv
	local	3,000020,pairs
	local	4,000020,weight
	local	5,000020,size
	local	6,000020,newlist
	local	7,000020,legal
	local	8,000020,illegal
	local	9,000000,numeric
	local	10,000000,copy
	local	11,000000,list
	local	12,000000,integer
	local	13,000000,real
	local	14,000000,put
	local	15,000000,set
	local	16,000000,member
	con	0,002000,1,0
	con	1,002000,3,100
	con	2,002000,2,50
	con	3,004000,0.5
	con	4,002000,1,1
	declend
	line	31
	colm	11
	mark	L1
	mark	L2
	var	9
	var	1
	line	33
	colm	10
	invoke	1
	esusp
	goto	L3
lab L2
	line	33
	colm	25
	pfail
lab L3
	unmark
lab L1
	mark	L4
	mark	L5
	pnull
	pnull
	int	0
	var	1
	line	34
	colm	6
	numle
	int	1
	line	34
	colm	20
	numle
	esusp
	goto	L6
lab L5
	line	34
	colm	30
	pfail
lab L6
	unmark
lab L4
	mark	L7
	pnull
	var	6
	var	10
	var	0
	line	35
	colm	18
	invoke	1
	line	35
	colm	11
	asgn
	unmark
lab L7
	mark	L8
	pnull
	var	5
	pnull
	var	6
	line	37
	colm	11
	size
	line	37
	colm	8
	asgn
	unmark
lab L8
	mark	L9
	pnull
	var	7
	var	11
	line	38
	colm	16
	invoke	0
	line	38
	colm	9
	asgn
	unmark
lab L9
	mark	L10
	mark	L11
	mark	L13
	pnull
	var	1
	int	2
	line	49
	colm	19
	numle
	esusp
	goto	L14
lab L13
	pnull
	var	1
	int	1
	line	49
	colm	40
	numeq
lab L14
	unmark
	mark	L15
	pnull
	var	3
	var	12
	pnull
	pnull
	var	5
	var	1
	line	50
	colm	28
	mult
	int	1
	line	50
	colm	41
	div
	line	50
	colm	22
	invoke	1
	line	50
	colm	11
	asgn
	unmark
lab L15
	mark0
	pnull
	var	3
	int	0
	line	52
	colm	14
	numgt
	unmark
	mark	L16
	pnull
	var	4
	var	12
	pnull
	pnull
	var	13
	var	5
	line	55
	colm	31
	invoke	1
	var	3
	line	55
	colm	38
	div
	real	3
	line	55
	colm	47
	plus
	line	55
	colm	25
	invoke	1
	line	55
	colm	14
	asgn
	unmark
lab L16
	mark	L17
	pnull
	var	2
	int	4
	line	58
	colm	11
	asgn
	unmark
lab L17
lab L18
	mark	L19
	pnull
	var	2
	var	5
	line	59
	colm	17
	numgt
	unmark
	efail
lab L19
	mark	L18
	mark	L22
	var	14
	var	7
	var	2
	line	60
	colm	13
	invoke	2
	unmark
lab L22
	pnull
	var	2
	dup
	var	4
	line	62
	colm	13
	plus
	asgn
lab L20
	unmark
	goto	L18
lab L21
	goto	L12
lab L11
	mark	L23
	pnull
	var	3
	var	12
	pnull
	pnull
	var	5
	pnull
	int	1
	var	1
	line	67
	colm	35
	minus
	line	67
	colm	28
	mult
	int	1
	line	67
	colm	49
	div
	line	67
	colm	22
	invoke	1
	line	67
	colm	11
	asgn
	unmark
lab L23
	mark0
	pnull
	var	3
	int	0
	line	69
	colm	14
	numgt
	unmark
	mark	L24
	pnull
	var	4
	var	12
	pnull
	var	5
	var	3
	line	70
	colm	31
	div
	line	70
	colm	25
	invoke	1
	line	70
	colm	14
	asgn
	unmark
lab L24
	mark	L25
	pnull
	var	8
	var	15
	pnull
	line	71
	colm	23
	llist	0
	line	71
	colm	22
	invoke	1
	line	71
	colm	15
	asgn
	unmark
lab L25
	mark	L26
	pnull
	var	2
	int	4
	line	72
	colm	11
	asgn
	unmark
lab L26
	mark	L27
lab L28
	mark	L29
	pnull
	var	2
	var	5
	line	73
	colm	17
	numgt
	unmark
	efail
lab L29
	mark	L28
	mark	L32
	pnull
	var	8
	dup
	var	15
	pnull
	var	2
	line	74
	colm	26
	llist	1
	line	74
	colm	25
	invoke	1
	line	74
	colm	17
	unions
	asgn
	unmark
lab L32
	pnull
	var	2
	dup
	var	4
	line	76
	colm	13
	plus
	asgn
lab L30
	unmark
	goto	L28
lab L31
	unmark
lab L27
	mark0
	pnull
	var	2
	pnull
	int	4
	var	5
	push1
	line	78
	colm	22
	toby
	line	78
	colm	17
	asgn
	pop
	mark0
	mark0
	mark	L35
	var	16
	var	8
	var	2
	line	79
	colm	23
	invoke	2
	unmark
	efail
lab L35
	pnull
	unmark
	var	14
	var	7
	var	2
	line	79
	colm	47
	invoke	2
	unmark
lab L33
	efail
lab L34
lab L12
	unmark
lab L10
	mark	L36
	mark0
	pnull
	pnull
	var	6
	pnull
	var	7
	line	82
	colm	17
	bang
	line	82
	colm	16
	subsc
	pnull
	var	6
	pnull
	var	7
	line	82
	colm	37
	random
	line	82
	colm	36
	subsc
	line	82
	colm	25
	swap
	pop
lab L37
	efail
lab L38
	unmark
lab L36
	mark	L39
	mark	L40
	var	6
	line	85
	colm	3
	pret
lab L40
	pfail
	unmark
lab L39
	pnull
	line	86
	colm	1
	pfail
	end
