Command reference / prog

CRTSRVPGM

Create Service Program

Creates a bound service program from a set of modules and binding directories.

Allowed environments: *ALL. Positional parameters: 1.

Restrictions

Parameters

SRVPGM Service program

Names the service program to create and the library where it is created. This parameter is required.

Type
*QUAL
Required
Yes
Case
Uppercase
*CURLIB
Creates the service program in the current library of the job, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Service program Service program

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*CURLIB
Length
10
Case
Uppercase

Suggested / special values: *CURLIB

MODULE Module

Lists up to 300 modules that are copied and bound together to create the service program. Duplicate module and library pairs are ignored after the first.

Type
*QUAL
Required
No
Default
*SRVPGM
List limit
300
Case
Uppercase

Suggested / special values: *SRVPGM

*SRVPGM
Uses the module and library names given for the SRVPGM parameter.
*ALL
Finds all module objects in the specified library or libraries.
*LIBL
Searches all libraries in the thread's library list until the first match.
*CURLIB
Searches the current library of the job, or QGPL if none is set.
*USRLIBL
Searches only the libraries in the user portion of the job's library list.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Module Module

Type
*GENERIC
Required
No
Length
10
Case
Uppercase

Suggested / special values: *ALL

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB, *USRLIBL

EXPORT Export

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

Type
*CHAR
Required
No
Default
*SRCFILE
Length
8
Case
Uppercase

Allowed values: *SRCFILE, *ALL

*SRCFILE
Exports are taken from the EXPORT statements in the source file member or stream file.
*ALL
All data and procedures exported from the specified modules are exported from the service program.

SRCFILE Export source file

Names the source file that holds the export specifications. It cannot be used with SRCSTMF.

Type
*QUAL
Required
No
Case
Uppercase
*LIBL
Searches all libraries in the library list until the first match.
*CURLIB
Searches the current library of the job, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Export source file Export source file

Type
*NAME
Required
No
Default
QSRVSRC
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

SRCMBR Export source member

Names the member in the export source file that holds the export specifications. It cannot be used with SRCSTMF.

Type
*NAME
Required
No
Default
*SRVPGM
Length
10
Case
Uppercase

Suggested / special values: *SRVPGM

*SRVPGM
The member has the same name as the service program.

SRCSTMF Export source stream file

Gives the path name of a stream file holding the export specifications. It cannot be used with SRCFILE or SRCMBR, or when TGTRLS names a release before V7R3M0.

Type
*CHAR
Required
No
Length
50
Case
Uppercase

TEXT Text 'description'

Briefly describes the service program, using up to 50 characters enclosed in apostrophes.

Type
*CHAR
Required
No
Default
*BLANK
Length
50
Case
Uppercase

Suggested / special values: *BLANK, *EXPORTSRC, *MODULE

*BLANK
No text is specified.
*EXPORTSRC
Uses the text description of the export source file. With EXPORT(*ALL) the text is blank.
*MODULE
Uses the text description of the first module in the MODULE parameter.

BNDSRVPGM Bind service program

Lists service program exports to check at bind time, to satisfy unresolved module import requests. Each named service program is bound and saved for use at run time. Up to 300 names can be specified.

Type
*ELEM
Required
No
Default
*NONE
List limit
300
Case
Uppercase

Suggested / special values: *NONE

*NONE
No service programs are provided for symbol resolution.
*ALL
Finds all service programs in the specified library or libraries. Use with care, especially with *LIBL.
*LIBL
Searches the library list for the service programs.
*IMMED
The bound service program is activated when the new service program is activated.
*DEFER
Activation of the bound service program may be deferred until one of its exported functions is called.
Elements in order

Service program Service program

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Service program Service program

Type
*GENERIC
Required
No
Length
10
Case
Uppercase

Suggested / special values: *ALL

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL

Activation Activation

Type
*CHAR
Required
No
Default
*IMMED
Length
6
Case
Uppercase

Allowed values: *IMMED, *DEFER

BNDDIR Binding directory

Lists up to 300 binding directories used in symbol resolution.

Type
*QUAL
Required
No
Default
*NONE
List limit
50
Case
Uppercase

Suggested / special values: *NONE

*NONE
No binding directory is specified.
*LIBL
Searches all libraries in the library list until the first match.
*CURLIB
Searches the current library of the job, or QGPL if none is set.
*USRLIBL
Searches only the libraries in the user portion of the job's library list.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Binding directory Binding directory

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB, *USRLIBL

ACTGRP Activation group

Specifies the activation group the service program is associated with when called. An activation group provides runtime data structures, addressing protection, a message boundary, and a cleanup boundary.

Type
*NAME
Required
No
Default
*CALLER
Length
10
Case
Uppercase

Suggested / special values: *CALLER

*CALLER
The service program is activated into the caller's activation group.

OPTION Creation options

Specifies up to six options used when the service program is created.

Type
*CHAR
Required
No
Length
10
List limit
6
Case
Uppercase

Allowed values: *GEN, *NOGEN, *NODUPPROC, *DUPPROC, *NODUPVAR, *DUPVAR, *WARN, *NOWARN, *RSLVREF, *UNRSLVREF, *NOEVENTF, *EVENTF

*GEN
A service program object is generated.
*NOGEN
A service program object is not generated.
*NODUPPROC
Each procedure name exported from the modules and service programs must be unique during symbol resolution.
*DUPPROC
Procedure names exported from the modules and service programs do not have to be unique.
*NODUPVAR
Each variable name exported from the modules and service programs must be unique during symbol resolution.
*DUPVAR
Variable names exported from the modules and service programs do not have to be unique.
*WARN
A diagnostic message is issued for any duplicate variables or procedures found.
*NOWARN
No diagnostic messages are issued for duplicates.
*RSLVREF
All imports must resolve to exports for the service program to be created.
*UNRSLVREF
Imports need not resolve. An unresolved import used at run time raises an MCH4439 exception.
*NOEVENTF
No event file is created for client tooling.
*EVENTF
An event file is created for client tooling, as a member of file EVFEVENT in the target library.

DETAIL Listing detail

Specifies the level of detail printed in the listing.

Type
*CHAR
Required
No
Default
*NONE
Length
9
Case
Uppercase

Allowed values: *NONE, *BASIC, *EXTENDED, *FULL

*NONE
No listing is generated.
*BASIC
Lists the CRTPGM options and processing statistics, and includes the Brief Summary Table.
*EXTENDED
Adds the Extended Summary Table and the Binding Information Listing to the basic listing.
*FULL
Adds the Cross-Reference Listing to the extended listing.

ALWUPD Allow update

Specifies whether the service program can be updated using the UPDSRVPGM command.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

Allowed values: *YES, *NO

*YES
The service program can be updated with UPDSRVPGM.
*NO
UPDSRVPGM cannot be used to update the service program.

ALWLIBUPD Allow *SRVPGM library update

Specifies whether UPDSRVPGM may change the bound service program library names of the service program being created.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
UPDSRVPGM cannot update the bound service program library names, even if ALWUPD(*YES) is specified.
*YES
UPDSRVPGM can update the bound service program library names when ALWUPD(*YES) is specified.

USRPRF User profile

Specifies whether authority is checked only for the user running the service program, or also for the owner.

Type
*CHAR
Required
No
Default
*USER
Length
6
Case
Uppercase

Allowed values: *USER, *OWNER

*USER
The profile of the service program user is used at run time.
*OWNER
The profiles of both the service program owner and the user are used at run time.

REPLACE Replace program

Specifies whether an existing service program with the same name in the library is replaced.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

Allowed values: *YES, *NO

*YES
The existing service program is moved to library QRPLOBJ. Current activations keep running the old version.
*NO
No replacement occurs, and an error is issued if the service program already exists.

AUT Authority

Sets the authority given to users who have no specific authority to the service program, are not on an authorization list, and whose group profiles have no specific authority.

Type
*NAME
Required
No
Default
*LIBCRTAUT
Length
10
Case
Uppercase

Suggested / special values: *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE

*LIBCRTAUT
Uses the CRTAUT value of the library where the object is created.
*CHANGE
All operations except those limited to the owner or to OBJEXIST and OBJMGT authority.
*ALL
All operations except those limited to AUTLMGT authority, including changing ownership.
*USE
Basic operations such as running the program, but no changes.
*EXCLUDE
The user cannot access the object.

TGTRLS Target release

Specifies the operating system release the object will be used on, in the form VxRxMx. Use F4 to see valid values.

Type
*CHAR
Required
No
Default
*CURRENT
Length
50
Case
Uppercase

Suggested / special values: *CURRENT, *PRV

*CURRENT
Used on the current release, and on any later release.
*PRV
Used on the previous release with modification level 0, and on any later release.

ALWRINZ Allow reinitialization

Specifies whether the static storage of the service program may be reinitialized while it is still active.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Static storage cannot be reinitialized while the program is active.
*YES
Static storage may be reinitialized while the program is active.

STGMDL Storage model

Specifies the storage model attribute of the service program.

Type
*CHAR
Required
No
Default
*SNGLVL
Length
10
Case
Uppercase

Allowed values: *SNGLVL, *TERASPACE, *INHERIT

*SNGLVL
Created with the single-level storage model and runs only in a single-level storage activation group.
*TERASPACE
Created with the teraspace storage model and runs only in a teraspace activation group.
*INHERIT
Adopts the storage model of the activation group it is activated into. Requires ACTGRP(*CALLER).

ARGOPT Argument optimization

Specifies whether argument optimization is performed during service program creation. It can improve performance of call-intensive applications but may lengthen creation time.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Argument optimization is not performed.
*YES
Argument optimization is performed.

IPA Interprocedural analysis

Specifies whether interprocedural analysis is used during service program creation.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Interprocedural analysis is not performed.
*YES
Interprocedural analysis is performed.

IPACTLFILE IPA control file

Gives the path name of a file with IPA suboption information. Allowed only when IPA(*YES) is specified.

Type
*CHAR
Required
No
Default
*NONE
Length
50
Case
Uppercase

Suggested / special values: *NONE

*NONE
No IPA control file information is used.

Examples

CRTSRVPGM SRVPGM(WORKDOC)

Creates service program WORKDOC in the current library. It is built from one module, also named WORKDOC, found using the current library of the job.

IBM command documentation

Generated from os/cl/catalog/CRTSRVPGM.json and os/cl/help/CRTSRVPGM.json.