Interview Questions

You are writing repirt program with 4 levels of totals: city ...

COBOL Interview Questions


(Continued from previous question...)

You are writing repirt program with 4 levels of totals: city ...

Q: You are writing repirt program with 4 levels of totals: city, state, region and country. The codes being used can be the same over the different levels, meaning a city code of o1 can be in any number of states, and the same applies to state and region code so how do you do your checking for breaks and how do you do add to each level?

A:
Always compare on the high-level first. because if you have a break at a highest level, each level beneath it must also break. Add to the lowest level for each record but add to the higher level only on a break.

(Continued on next question...)

Other Interview Questions