EXTPGM{(name)}

The EXTPGM keyword indicates that the prototype represents a dynamic call to a program.

The parameter specifies the external name of the program whose prototype is being defined. The name can be a character constant or a character variable.

The parameter is optional if the prototype name is not longer than 10 characters. If the parameter is not specified, the external program name is the same as the upper-case form of the prototype name. The following example defines a prototype for program 'QCMDEXC'.

  DCL-PR qcmdExc EXTPGM;
     ...

If neither EXTPGM or EXTPROC is specified for a prototype, then the compiler assumes that you are defining a prototype for a procedure, and assigns the external procedure name to be the upper-case form of the prototype name.

Any parameters defined by a prototype or procedure interface with EXTPGM must be passed by reference. In addition, you cannot define a return value.