what about evaluate?
what about not using compute?
What happens when you break down the steps of the computation?
Is there a difference between using stored values and literals?
I was at one site that claimed if you use COMP-5 and forced pure binary computations it was faster.
I have seen instatnces where COMP AND COMP-3 Both were used depending on the size of the variable. i.e. using a binary for and even number like a 4 digit or 8 digit number and using COMP-3 for odd numbered variables like "PIC 9(05)V99 COMP-3". In days gone by storage cost more than processing power, so the reasoning was sometimes different. As a rule of thumb, I never use an even number of digits so I dont waste space, however, if I dont use the extra digit it is wasted anyway, but I cant stand that the compiler cant use that extra nipple.
No one ever bothered to bring up the fact that a sign makes a computation faster when I was in school, but I find it interesting. Since I dont have a huge file system to experiment with, it can be difficult to determine a need for such a thing. I wonder how databases use techniques to make them run faster. We are in the middle of a switch from COBOL on the Mainfram (Emulated) to an IBM Database system that is not even Relational (Unidata). It seems kind of convoluted. The math used in a file system for a school is not that fancy. hrs * Rate is not that complicated to figure out. We are not doing calculus. So maybe if I make Linecount a signed comp-3 or a binary it will run faster. Probably not worth messing with in the long run. Maybe Accounting Programs would be faster, but we already use signed fields there. It is a real pain to display a comp-3 field to look at it.
I find this an interesting subject. We do this procedure which I find to be a pain in the neck. We take the last four digits and put it in the front of the social security number and then take that result and put it in a comp-3 field and then move that to a pic x(05). It is suppose to make the id (SSN) SPREAD OUT OVER THE STORAGE SPACE MORE EVENLY AND MAKE IT EASIER TO FIND THE RIGHT NUMBER USING RANDOM ACCESS. You see a SSN often starts with 12345 more often than other numbers, so they bunch up and dont sort well. It has been done this way a long time so it is just a learned technique. File access may take longer than a computation, so what takes the most time and what is more important? In our new system we just use numbers for person ID's so that is completely different.
If you do not like my post feel free to point out your opinion or my errors.