You can specify as many sort keys as you like. Normally you won't notice any difference between the two methods of leaving a program. It is good practice when programming to check the VSAM status code after any operation carried out on a VSAM file to check that the OPEN, READ, etc completed successfully. The codes returned are listed in the table below. There are various methods of improving the efficiency of your code from the way you code your program to the compiler options you choose.
Some arithmetical calculations take longer than others.
Multiplication and division take longer than adding or subtracting. If you want to make a number negative, you could subtract it from 0, instead of multiplying it by -1. If you have multiple OR conditions on your IF statement try and make sure that the condition most likely to be true is first in the list. This means that the program will not have to check as many conditions before finding a 'true' one. Here's an example to illustrate this.