If category is A you want to add 1 to CTA, if category is B you want to add 1 to CTB else you want to add 1 to CTOTHER.
If category is A and either num_comm is greater than the reorder point or on_hand = 0, you want to move the word ORDER to MSG.
If the person on the record EITHER makes over 40000 OR owns hteir own home AND it is worth over 12000, move ELIGIBLE to MSG otherwise move NOT ELIGIBLE to MSG.
If the department is 12 AND num_comm is greater than reord_pt AND either cost is greater than 25 OR price is greater than 35, add 1 to DEPT12A_CT. If the department is 12 and the num_comm is not greater than the reord_pt AND on_order is greater than 20, add 1 to DEPT12B_CT. In all other cases add to NOT_CT.
I branch up to the do while to see if I should do it again.
Here I do an initializing read of the first record and enter the do loop which I do as long as I have successfully read a record. Note that I read again just before I loop back to check. Each time I read, I read a new record from the file. Each time I process, I display one number that I calculated as I processed the record.