Create Service Program (CRTSRVPGM)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Create Service Program (CRTSRVPGM) command creates a bound service program from a set of modules and binding directories.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
SRVPGM Service program Qualified object name Required, Positional 1
Qualifier 1: Service program Name
Qualifier 2: Library Name, *CURLIB
MODULE Module Single values: *SRVPGM
Other values (up to 300 repetitions): Qualified object name
Optional
Qualifier 1: Module Generic name, name, *ALL
Qualifier 2: Library Name, *LIBL, *CURLIB, *USRLIBL
EXPORT Export *SRCFILE, *ALL Optional
SRCFILE Export source file Qualified object name Optional
Qualifier 1: Export source file Name, QSRVSRC
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCMBR Export source member Name, *SRVPGM Optional
TEXT Text 'description' Character value, *BLANK Optional
BNDSRVPGM Bind service program Single values: *NONE
Other values (up to 300 repetitions): Qualified object name
Optional
Qualifier 1: Bind service program Generic name, name, *ALL
Qualifier 2: Library Name, *LIBL
BNDDIR Binding directory Single values: *NONE
Other values (up to 300 repetitions): Qualified object name
Optional
Qualifier 1: Binding directory Name
Qualifier 2: Library Name, *LIBL, *CURLIB, *USRLIBL
ACTGRP Activation group Name, *CALLER Optional
OPTION Creation options Values (up to 5 repetitions): *GEN, *NOGEN, *NODUPPROC, *DUPPROC, *NODUPVAR, *DUPVAR, *WARN, *NOWARN, *RSLVREF, *UNRSLVREF Optional
DETAIL Listing detail *NONE, *BASIC, *EXTENDED, *FULL Optional
ALWUPD Allow update *YES, *NO Optional
ALWLIBUPD Allow *SRVPGM library update *YES, *NO Optional
USRPRF User profile *USER, *OWNER Optional
REPLACE Replace program *YES, *NO Optional
AUT Authority Name, *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE Optional
TGTRLS Target release Character value, *CURRENT, *PRV Optional
ALWRINZ Allow reinitialization *NO, *YES Optional
STGMDL Storage model *SNGLVL, *TERASPACE, *INHERIT Optional
IPA Interprocedural analysis *YES, *NO Optional
IPACTLFILE IPA control file Path name, *NONE Optional
Top

Service program (SRVPGM)

Specifies the service program object to be created.

This is a required parameter.

Qualifier 1: Service program

name
Specify the name of the service program to be created.

Qualifier 2: Library

*CURLIB
The service program is created in the current library for the job. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library where the service program is to be created.
Top

Module (MODULE)

Specifies the list of modules that are copied and bound together to create the service program object. If duplicate module and library specifications are found, only the first instance of the duplicate module and library is used. Modules in this list are copied into the final service program object. Up to 300 names can be specified.

Single values

*SRVPGM
The module and library names specified for the Service program (SRVPGM) parameter are used.

Qualifier 1: Module

*ALL
Find all module objects in the specified library or libraries.
generic-name
Specify all module objects starting with the characters preceding the * in the specified library or libraries.
name
Specify the name of the module that is copied to create the service program object.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
*USRLIBL
Only the libraries in the user portion of the job's library list are searched.
name
Specify the name of the library to be searched.
Top

Export (EXPORT)

Specifies the names of the data and procedures this service program exports.

*SRCFILE
The source file member identified by the Source file (SRCFILE) and Source member (SRCMBR) parameters contains EXPORT statements that identify the data and procedures to export from the service program.
*ALL
All data and procedures that are exported from the specified modules are also exported from the service program.
Top

Source file (SRCFILE)

Specifies the source file containing the specifications for exporting data and procedures from this service program.

Qualifier 1: Export source file

QSRVSRC
The source file containing the specifications for exporting data and procedures is named QSRVSRC.
name
Specify the name of the source file containing the specifications for exporting data and procedures.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library to be searched.
Top

Source member (SRCMBR)

Specifies the name of the source file member containing the specifications for exporting data and procedures from this service program.

*SRVPGM
The source file member name is the same name as the service program name specified for the Service program (SRVPGM) parameter.
name
Specify the name of the member in the source file containing the specifications for exporting data and procedures.
Top

Text 'description' (TEXT)

Specifies text that briefly describes the service program object.

*BLANK
Text is not specified.
character-value
Specify no more than 50 characters of text, enclosed in apostrophes.
Top

Bind service program (BNDSRVPGM)

Specifies the list of service program exports to examine at bind time to ensure they satisfy any module import requests. The service program exports are checked only if there are unresolved module import requests not satisfied by the set of module exports. Any service program specified on the BNDSRVPGM parameter that satisfies a module import request will be bound to the service program being created. The service program name and the library specified on the BNDSRVPGM parameter are saved to be used at run time. Up to 300 names can be specified.

Single values

*NONE
No service programs are provided for symbol resolution.

Qualifier 1: Bind service program

*ALL
Find all service program objects in the specified library or libraries.

Note: This value should only be specified in a user-controlled environment when you know exactly what is getting bound to your service program. Specifying *LIBL with *ALL may give you unpredictable results at service program run time. Specify the generic service program name or specific libraries to better control what gets bound to your service program.

generic-name
Specify all service program objects starting with the characters preceding the * in the specified library or libraries.
name
Specify the name of the service program to be examined during symbol resolution.

Qualifier 2: Library

*LIBL
Search all of the libraries in the job's library list for the specified service programs. If one of the service programs has an export that satisfies a module import, then the library list is searched at run-time to find this service program.
name
Specify the name of the library where the service programs can be found. If one of the service programs has an export that satisfies a module import, and a specific library was specified, the specified library is searched at run-time to find this service program.

Note: QTEMP is not a valid library name for this parameter.

Top

Binding directory (BNDDIR)

Specifies the list of binding directories that are used in symbol resolution. Up to 300 names can be specified.

Single values

*NONE
No binding directory is specified.

Qualifier 1: Binding directory

name
Specify the name of the binding directory used in symbol resolution.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
*USRLIBL
Only the libraries in the user portion of the job's library list are searched.
name
Specify the name of the library to be searched.
Top

Activation group (ACTGRP)

Specifies the activation group this service program is associated with when it is called. An activation group provides:

*CALLER
When this service program gets called, the service program is activated into the caller's activation group.
name
Specify the name of the group that is associated with this called service program. If an activation group, by the specified name, currently exists when this service program is called, the service program is associated with the already existing activation group. If an activation group, by the specified name, does not currently exist when this service program is called, then a new activation group is created and the service program is associated with the newly created activation group.
Top

Creation options (OPTION)

Specifies options to be used when the service program object is created.

You can specify up to 5 values for this parameter.

Service Program Objects

*GEN
A service program object is generated.
*NOGEN
A service program object is not generated.

Duplicate Procedure Names

*NODUPPROC
During the symbol resolution phase of the binding process, each procedure name that is exported from the modules and service programs must be unique.
*DUPPROC
During the symbol resolution phase of the binding process, the procedure names that are exported from the modules and service programs do not have to be unique. When multiple duplicate procedures are allowed, the first exported procedure in the list of specified modules and service program that matches the import request is the procedure that is selected.

Duplicate Variable Names

*NODUPVAR
During the symbol resolution phase of the binding process, each variable name that is exported from the modules and service programs must be unique.
*DUPVAR
During the symbol resolution phase of the binding process, the variable names that are exported from the modules and service programs do not have to be unique. When multiple duplicate variables are allowed, the first exported variable in the list of specified modules and service programs that matches the import request is the variable that is selected.

Issuing Diagnostic Messages

*WARN
If duplicate variables or procedures are found, then a diagnostic message is issued indicating what duplicates were found.
*NOWARN
If duplicate variables or procedures are found, diagnostic messages are not issued.

Resolving References (Imports)

*RSLVREF
All imports must be resolved to exports for the service program to be created.
*UNRSLVREF
All imports do not need to resolve to exports for the service program to be created. If the service program tries to use one of these unresolved imports at run time, a MCH4439 run-time exception is issued.
Top

Listing detail (DETAIL)

Specifies the level of detail to be printed.

*NONE
A listing is not generated.
*BASIC
Contains a listing of the options passed to CRTPGM, and processing statistics. This listing also contains the Brief Summary Table.
*EXTENDED
In addition to the information provided in the *BASIC listing, this listing contains the Extended Summary Table and the Binding Information Listing.
*FULL
This listing contains the *EXTENDED listing and the Cross-Reference Listing.

Note: If a printed listing is requested, the printer file *LIBL/QSYSPRT is used to generate the listing.

Top

Allow update (ALWUPD)

Specifies whether to allow an update of the service program being created using the Update Service Program (UPDSRVPGM) command.

*YES
The service program can be updated using the UPDSRVPGM command.
*NO
The UPDSRVPGM command cannot be used to update the service program being created.
Top

Allow *SRVPGM library update (ALWLIBUPD)

Specifies whether to allow the bound service program library name of the service program being created to be changed when updated using the UPDSRVPGM command.

*NO
The UPDSRVPGM command is not allowed to update the bound service program library names of the service program being created, even if *YES is specified for the Allow update (ALWUPD) parameter.
*YES
The UPDSRVPGM command is allowed to update the bound service program library names of the service program being created when ALWUPD(*YES) is specified.
Top

User profile (USRPRF)

Specifies whether authority checking is performed only for the user running the service program, or for both the user running the service program and the service program owner.

*USER
The user profile of the service program user is used when the service program is run.
*OWNER
The user profile of both the service program owner and the service program user is used when the service program is run.
Top

Replace program (REPLACE)

Specifies whether the existing service program is replaced if a service program by the same name already exists in the specified library.

*YES
Replace the existing service program by moving it to the QRPLOBJ library. Current activations of the service program will continue running using the version of the service program in the QRPLOBJ library.

Note: Both service programs must be owned by the same user for the replace to work.

*NO
No replacement occurs. An error message is issued if a service program already exists with the name and library specified for the &Service program (SRVPGM) parameter.
Top

Authority (AUT)

Specifies the authority you are giving to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object.

*LIBCRTAUT
The system determines the authority for the object by using the value specified for the Create authority (CRTAUT) parameter on the Create Library command (CRTLIB) for the library containing the object to be created. If the value specified for the CRTAUT parameter is changed, the new value will not affect any existing objects.
*CHANGE
The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
*ALL
The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the object.
*USE
The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*EXCLUDE
The user cannot access the object.
name
Specify the name of an authorization list to be used for authority to the object. Users included in the authorization list are granted authority to the object as specified in the list. The authorization list must exist when the object is created.
Top

Target release (TGTRLS)

Specifies the release of the operating system on which you intend to use the object being created.

When specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V5R3M0 is version 5, release 3, modification 0.

Valid values depend on the current version, release, and modification level of the operating system, and they change with each new release. You can press F4 while prompting this command parameter to see a list of valid target release values.

*CURRENT
The object is to be used on the release of the operating system currently running on your system. The object can also be used on a system with any subsequent release of the operating system installed.
*PRV
The object is to be used on the previous release with modification level 0 of the operating system. The object can also be used on a system with any subsequent release of the operating system installed.
character-value
Specify the release in the format VxRxMx. The object can be used on a system with the specified release or with any subsequent release of the operating system installed.
Top

Allow reinitialization (ALWRINZ)

Specifies if the static storage of the service program is allowed to be reinitialized while it is still active.

*NO
The static storage of the service program can not be reinitialized while it is still active.
*YES
The static storage of the service program is allowed to be reinitialized while the service program is still active.
Top

Storage model (STGMDL)

Specifies the storage model attribute of the service program.

*SNGLVL
The service program is created with single-level storage model. When a single-level storage model service program is activated and run, it is supplied single-level storage for automatic and static storage. A single-level storage service program runs only in a single-level storage activation group.
*TERASPACE
The service program is created with teraspace storage model. When a teraspace storage model service program is activated and run, it is supplied teraspace storage for automatic and static storage. A teraspace storage service program runs only in a teraspace storage activation group.
*INHERIT
The service program is created with inherit storage model. When activated, the service program adopts the storage model of the activation group into which it is activated. An equivalent view is that it inherits the storage model of its caller. When the *INHERIT storage model is selected, *CALLER must be specified for the Activation group (ACTGRP) parameter.
Top

Interprocedural analysis (IPA)

Specifies whether interprocedural analysis (IPA) is to be used during the service program creation. For more information on IPA, refer to the ILE Concepts book, SC41-5606.

*NO
Interprocedural analysis will not be performed.
*YES
Interprocedural analysis will be performed.
Top

IPA control file (IPACTLFILE)

Gives the path name of a file which contains interprocedural analysis (IPA) suboption information. This parameter is allowed only when IPA(*YES) is specified.

*NONE
No IPA control file information is to be used when IPA(*YES) is specified.
path-name
Specify the path name of the IPA control file to use when IPA(*YES) is specified. If the name is qualified it must be enclosed in apostrophes. An example of a qualified IPA control file name is '/directory1/directory2/myipactlfname'
Top

Examples

CRTSRVPGM   SRVPGM(WORKDOC)

This command creates the service program object named WORKDOC in the current library. The service program will be created from one module object that is also named WORKDOC and is located using the current library for the job.

Top

Error messages

*ESCAPE Messages

CPF223E
Authority check for use adopted authority attribute failed.
CPF5D05
Service program &1 not created.
CPF5D07
Export source file record length greater than 240.
CPF5D12
Error encountered during program or service program preparation.
Top