main
define contact_no integer
declare label_cur cursor for
select * from contact
order by last_name, first_name
foreach label_cur into label_rec.*
let contact_no = contact_no + 1
display "Name: ", label_rec.first_name, label_rec.last_name
end foreach
display "Found ", contact_no, "records."
end main