Joined: 06 Jun 2008 Posts: 8212 Location: Dubuque, Iowa, USA
I have to wonder -- why do you ask? The z10 is fast enough that you have to do, literally, BILLIONS of arithmetic operations with a variable to detect any difference in CPU time or elapsed time when using COMP versus COMP-3.
The only time that you should be concerned with performance these days is after someone tells you that a program is taking too long. Until then, it is pretty much a waste of time to attempt to make performance improvements.
And Meenakshi's answer is not complete -- if you need more than 18 decimal digits, you must use COMP-3 (or DISPLAY) as COMP variables cannot exceed 18 digits while COMP-3 can be up to 31 digits (with a compiler option).
Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
Adding to Meenakshi's reply, if your compiler supports COMP-5 (Native Binary), then define all of your COMP/BINARY fields as COMP-5.
Otherwise, depending on the size of your arithmetic data, you may need to specify the compiler option TRUNC(BIN), which is brutally inefficient. If TRUNC(BIN) is necessary, then you might as well define your COMP fields as COMP-3, because TRUNC(BIN) performs arithmetic using packed-decimal instructions, so there's no benefit.