Export Parameter on the CRTSRVPGM Command

The export (EXPORT), source file (SRCFILE), source member (SRCMBR), Start of changeand source stream file (SRCSTMF)End of change parameters identify the public interface to the service program being created. The parameters specify the exports (procedures and data) that a service program makes available for use by other ILE programs or service programs.

The default value for the export parameter is *SRCFILE. That value directs the binder to the SRCFILE Start of changeor SRCSTMFEnd of change parameter for a reference to information about exports of the service program. This additional information is a source file with binder language source in it (see Binder Language). The binder locates the binder language source and, from the specified names to be exported, generates one or more signatures. The binder language also allows you to specify a signature of your choice instead of having the binder generate one.

The Retrieve Binder Source (RTVBNDSRC) command can be used to create a source file that contains binder language source. The source can be based on either an existing service program or a set of modules. If based on a service program, the source is appropriate for recreating or updating that service program. If based on a set of modules, the source contains all symbols eligible to be exported from the modules. In either case, you can edit this file to include only the symbols you want to export, then you can specify this file using the SRCFILE Start of changeor SRCSTMFEnd of change parameter of the CRTSRVPGM or UPDSRVPGM commands.

The other possible value for the export parameter is *ALL. When EXPORT(*ALL) is specified, all of the symbols exported from the copied modules are exported from the service program. The signature that gets generated is determined by the following:
  • The number of exported symbols
  • Alphabetical order of exported symbols

If EXPORT(*ALL) is specified, no binder language is needed to define the exports from a service program. By specifying this value, you do not need to generate the binder language source. However, a service program with EXPORT(*ALL) specified can be difficult to update or correct if the exports are used by other programs. If the service program is changed, the order or number of exports might change. Therefore, the signature of that service program might change. If the signature changes, all programs or service programs that use the changed service program have to be re-created.

EXPORT(*ALL) indicates that all symbols exported from the modules used in the service program are exported from the service program. ILE C can define exports as global or static. Only external variables declared in ILE C as global are available with EXPORT(*ALL). In ILE RPG, the following are available with EXPORT(*ALL):
  • The RPG main procedure name
  • The names of any exported subprocedures
  • Variables defined with the keyword EXPORT
In ILE COBOL, the following language elements are module exports:
  • The name in the PROGRAM-ID paragraph in the lexically outermost COBOL program (not to be confused with *PGM object) of a compilation unit. This maps to a strong procedure export.
  • The COBOL compiler-generated name derived from the name in the PROGRAM-ID paragraph in the preceding bullet if that program does not have the INITIAL attribute. This maps to a strong procedure export. For information about strong and weak exports, see Export in Import and Export Concepts.
  • Any data item or file item declared as EXTERNAL. This maps to a weak export.