Parsing Program Names on a Call

Program names are specified in factor 2 of a CALL operation or as the parameter of the EXTPGM keyword on a prototype or procedure interface. If you specify the library name, it must be immediately followed by a slash and then the program name (for example, 'LIB/PROG'.). If a library is not specified, the library list is used to find the program. *CURLIB is not supported.

Note the following rules:

The program name is used exactly as specified in the literal, field, named constant, or array element to determine the program to be called. Specifically:

Program references are grouped to avoid the overhead of resolving to the target program. All references to a specific program using a named constant or literal are grouped so that the program is resolved to only once, and all subsequent references to that program (by way of named constant or literal only) do not cause a resolve to recur.

The program references are grouped if both the program and the library name are identical. All program references by variable name are grouped by the variable name. When a program reference is made with a variable, its current value is compared to the value used on the previous program reference operation that used that variable. If the value did not change, no resolve is done. If it did change, a resolve is done to the new program specified. Note that this rule applies only to references using a variable name. References using a named constant or literal are never re-resolved, and they do not affect whether or not a program reference by variable is re-resolved. Figure 175 illustrates the grouping of program references.



[ Top of Page | Previous Page | Next Page | Contents | Index ]