Choosing a data type

Use the int data type instead of char when performing arithmetic operations.
char_var += '0';
int_var  += '0';         /*  better  */
A char type variable is efficient when you are: For example:
char_var = 27;
if (char_var == 'D')
Table 1 lists analogous data types and shows which data types are more expensive to reference.
Table 1. Referencing data types
More Expensive Less Expensive
unsigned short signed short (Although unsigned short is less expensive on many systems, the z/OS® implementation of signed short is less expensive.)
signed char unsigned char
long double double
Longer decimal Shorter decimal
For storage efficiency, the compiler packs enumeration variables in 1, 2 or 4 bytes, depending on the largest value of a constant. When performance is critical, expand the size to a fullword either by adding an enumeration constant with a large value or by specifying the ENUMSIZE compiler option. For example:
enum byte { land, sea, air, space };

enum word { low, medium, high, expand_to_fullword = INT_MAX };
Example that is equivalent to using the ENUMSIZE(INT) compiler option:
enum word { low, medium, high };

Fullword enumeration variables are preferred as function parameters.

For efficient use of extern variables:
When using float:
When using bit fields, be aware that: