As Dick and Prino alluded to, try to avoid data type conversions. For math operations, use the same data types. Whenever possible avoid float and packed types unless the data you are working with is already in that format. Maybe I should restrict that to say use FIXED BIN for all program control, indices, etc.
The same thing goes for Character operations. Avoid unnecessary conversions from numeric to character types. Find the most efficient means to do things like concatenation. Sometimes that means writing a small, specialized assembler routine to do something common.
Compile without runtime checks where appropriate.
Avoid external library calls when possible, at least for trivial tasks.
Cache data in memory rather than make repetitive reads.
And as has already been said several times, before you do any of this, see if your algorithm can be improved. It doesn't matter how you use a programming language if the algorithm is bad.
Joined: 06 Jun 2008 Posts: 8165 Location: East Dubuque, Illinois, USA
How can we reduce the MIPS Consumption in PL/1 & DB2 Code.What are the possible ways to reduce atleast 0.5 %.
Misconception number one: you want to reduce CPU consumption (presumably) since MIPS is (a) not typically referenced for individual programs, and (b) not a very good way to measure since it typically is not available without using specialized tools. And note that even when IBM was using MIPS, the workload being measured included cpu usage, input/output to disk and tape, and otherwise represented the entire machine -- not just CPU time.
Misconception number two: reducing the CPU time 0.5% is worth taking the time to look at. Unless the job is taking a lot of CPU time (i.e., running for literally days not hours at a time), you're not going to save enough time to make any significant difference.