Create Program and Create Service Program Commands
The Create Program (CRTPGM) and Create Service Program (CRTSRVPGM) commands look similar and share many of the same parameters. Comparing the parameters used in the two commands helps to clarify how each command can be used.
Table 1 shows the commands and their parameters with the default values supplied.
| Parameter Group | CRTPGM Command | CRTSRVPGM Command |
|---|---|---|
| Identification | PGM(*CURLIB/WORK) MODULE(*PGM) | SRVPGM(*CURLIB/UTILITY) MODULE(*SRVPGM) |
| Program access | ENTMOD(*FIRST) | EXPORT(*SRCFILE) SRCFILE(*LIBL/QSRVSRC) SRCMBR(*SRVPGM) |
| Binding | BNDSRVPGM(*NONE) BNDDIR(*NONE) | BNDSRVPGM(*NONE) BNDDIR(*NONE) |
| Runtime | ACTGRP(*ENTMOD) | ACTGRP(*CALLER) |
| Optimization | IPA(*NO) IPACTLFILE(*NONE) ARGOPT(*NO) | IPA(*NO) IPACTLFILE(*NONE) ARGOPT(*NO) |
| Miscellaneous | OPTION(*GEN *NODUPPROC *NODUPVAR *WARN *RSLVREF) DETAIL(*NONE) ALWUPD(*YES) ALWLIBUPD(*NO) ALWRINZ(*NO) REPLACE(*YES) AUT(*LIBCRTAUT) TEXT(*ENTMODTXT) TGTRLS(*CURRENT) USRPRF(*USER) STGMDL(*SNGLVL) | OPTION(*GEN *NODUPPROC *NODUPVAR *WARN *RSLVREF) DETAIL(*NONE) ALWUPD(*YES) ALWLIBUPD(*NO) ALWRINZ(*NO) REPLACE(*YES) AUT(*LIBCRTAUT) TEXT(*ENTMODTXT) TGTRLS(*CURRENT) USRPRF(*USER) STGMDL(*SNGLVL) |
The identification parameters for both commands name the object to be created and the modules copied. The only difference in the two parameters is in the default module name to use when creating the object. For CRTPGM, use the same name for the module as is specified on the program (*PGM) parameter. For CRTSRVPGM, use the same name for the module as is specified on the service program (*SRVPGM) parameter. Otherwise, these parameters look and act the same.
The most significant similarity in the two commands is how the binder resolves symbols between the imports and exports. In both cases, the binder processes the input from the module (MODULE), bound service program (BNDSRVPGM), and binding directory (BNDDIR) parameters.
The most significant difference in the commands is with the program-access parameters (see Program Access). For the CRTPGM command, all that needs to be identified to the binder is which module has the program entry procedure. Once the program is created and a dynamic program call is made to this program, processing starts with the module containing the program entry procedure. The CRTSRVPGM command needs more program-access information because it can supply an interface of several access points for other programs or service programs.