Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide

Avoiding calls to library routines

The bitwise operations (prefix NOT, infix AND, infix OR, and infix EXCLUSIVE OR) are often evaluated by calls to library routines. These operations are, however, handled without a library call if either of the following conditions is true:

For certain assignments, expressions, and built-in function references, the compiler generates calls to library routines. If you avoid these calls, your code generally runs faster.

To help you determine when the compiler generates such calls, the compiler generates a message whenever a conversion is done using a library routine. The conversions done with code generated inline are shown in Table 25.

Table 25. Conditions under which conversions are handled inline
Target Source Condition
fixed bin(p1,q1)
fixed bin(p2,q2)
float(p2)
bit(1)
bit(n) aligned
char(1)
pic'(n)9'
pic'(n)Z(m)9'
always
if SIZE is disabled
always
if n is known and n <= 31

if CONV is disabled
if n <= 6

if n + m <= 6
fixed dec(p1,q1) fixed dec(p2,q2) done using an especially fast library routine
float(p1)
fixed bin(p2,q2)
float(p2)
bit(1)
bit(n) aligned
char(1)
pic'(n)9'
pic'(n)Z(m)9'
always
always
always
if n is known and n <= 31

if CONV is disabled
if n <= 6

if n + m <= 6
pictured fixed pictured fixed if pictures match
pictured float pictured float if pictures match
char
char nonvarying
char varying
char varyingz
pictured fixed
pictured float
pictured char
always
always
always
always
always
always
pictured char pictured char if pictures match
bit(1) nonvarying bit(1) nonvarying always
bit(n) nonvarying bit(m) nonvarying see note
Note:
If all of the following apply:
1) source and target are byte-aligned
2) n and m are known
3) mod(m,8)=0 or n=m or source is a constant
4) mod(n,8)=0 or target is a scalar with STATIC,
AUTOMATIC, or CONTROLLED attributes

Many string-handling built-in functions are evaluated through calls to library routines, but some are handled without a library call. Table 26 lists these built-in functions and the conditions under which they are handled inline.

Table 26. Conditions under which string built-in functions are handled inline
String function Comments and conditions
BOOL When the third argument is a constant. The first two arguments must also be either both bit(1) or both aligned bit(n) where n is 8, 16 or 32. The function is also handled inline if it can be reduced to a bitwise infix operation and both arguments are aligned bit.
COPY When the first argument has type character.
EDIT When the first argument is REAL FIXED BIN, the SIZE condition is disabled, and the second argument is a constant string consisting of all 9's.
HIGH Always
INDEX When only two arguments are supplied and they have type character.
LENGTH Always
LOW Always
MAXLENGTH Always
SEARCH When only two arguments are supplied and they have type character.
SEARCHR When only two arguments are supplied and they have type character.
SUBSTR When STRINGRANGE is disabled.
TRANSLATE When the second and third arguments are constant.
TRIM When only one argument is supplied and it has type character.
UNSPEC Always
VERIFY When only two arguments are supplied and they have type character.
VERIFYR When only two arguments are supplied and they have type character.
Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide