You need to build the code - we will help when there are problems/questions.
You need something like:
move 1 to the subscript
move code(s) to out-code
move desc(s) to out-desc
if code(s) not = '999' go to loop
... whatever is next
We will help but we won't actually do the assignment for you. Actually, if someone posts the complete coded solution, it will be deleted.