Where allowed to run:
|
Parameters Examples Error messages |
The Declare Processing Options (DCLPRCOPT) command lets you define compiler processing options. These options can control the behavior of the compiler or modify the attributes of the program or module object generated by the CL compiler.
You can use the DCLPRCOPT command to set compiler parameters in your CL source program instead of specifying the same parameters on the CL command used to invoke the CL compiler (CRTCLPGM, CRTCLMOD or CRTBNDCL).
Restrictions:
| Top |
| Keyword | Description | Choices | Notes |
|---|---|---|---|
| SUBRSTACK | Subroutine stack depth | 20-9999, 99 | Optional, Positional 1 |
| LOG | Log commands | *JOB, *YES, *NO | Optional |
| ALWRTVSRC | Allow RTVCLSRC | *YES, *NO | Optional |
| TEXT | Text 'description' | Character value, *SRCMBRTXT, *BLANK | Optional |
| USRPRF | User profile | *USER, *OWNER | Optional |
| AUT | Authority | Name, *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE | Optional |
| DBGENCKEY | Debug encryption key | Character value, *NONE | Optional |
| STGMDL | Storage model | *SNGLVL, *TERASPACE | Optional |
| DFTACTGRP | Default activation group | *YES, *NO | Optional |
| ACTGRP | Activation group | Name, *STGMDL, *NEW, *CALLER | Optional |
| BNDSRVPGM | Bind service program | Single values: *NONE Other values (up to 300 repetitions): Element list |
Optional |
| Element 1: Service program | Qualified object name | ||
| Qualifier 1: Service program | Generic name, name, *ALL | ||
| Qualifier 2: Library | Name, *LIBL | ||
| Element 2: Activation | *IMMED, *DEFER | ||
| 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 |
| Top |
Specifies how many entries you want to allow on the subroutine stack. Each time a CALLSUBR (Call Subroutine) command is run, an entry is added on the subroutine stack. The entry is removed when a RTNSUBR (Return from Subroutine) or ENDSUBR (End Subroutine) command is run. The subroutine stack can have multiple entries when CALLSUBR commands are run from within a subroutine; a subroutine can invoke another subroutine or recursively invoke itself.
| Top |
Specifies the logging options for a created CL program or module.
A *YES or *NO value takes precedence over any value specified in the CHGJOB command.
| Top |
Specifies whether the CL source is saved with the module or program object. Source that is saved can be retrieved later by using the Retrieve CL Source (RTVCLSRC) command.
| Top |
Specifies text that briefly describes the compiled CL program or module object.
| Top |
Specifies whether the authority checking done while this program is running includes only the user who is running the program (*USER) or both the user running the program and the program owner (*OWNER). The profiles of the program user or both the program user and the program owner are used to control which objects can be used by the program, including the authority the program has for each object.
Note: This parameter is ignored if REPLACE(*YES) is specified and a program already exists with the name specified by the PGM parameter on the CRTCLPGM or CRTBNDCL command.
Note: This parameter is only applicable if the CL source is compiled using the CRTCLPGM or CRTBNDCL command. For CRTCLMOD, any value specified for this parameter is ignored.
| Top |
Specifies the authority you are granting to the users who do not have specific authority for the object, who are not on the authorization list, and whose user group has no specific authority for the object.
Note: This parameter is ignored when REPLACE(*YES) is specified and an object by the specified name already exists in the specified library.
| Top |
Specifies the encryption key to be used to encrypt program source that is embedded in debug views.
Note: This parameter is only applicable if the CL source is compiled using the CRTBNDCL or CRTCLMOD commands. For CRTCLPGM, any value specified for this parameter is ignored.
If the key contains any characters which are not invariant over all code pages, it will be up to the user to ensure that the target system uses the same code page as the source system, otherwise the key may not match and the decryption may fail. If the encryption key must be entered on systems with differing code pages, it is recommended that the key be made of characters which are invariant for all EBCDIC code pages.
| Top |
Specifies the storage model attribute of the ILE CL program.
Note: This parameter is only applicable if the CL source is compiled using the CRTBNDCL command. For CRTCLPGM and CRTCLMOD, any value specified for this parameter is ignored.
| Top |
Specifies whether the ILE CL program is associated with the default activation group.
Note: This parameter is only applicable if the CL source is compiled using the CRTBNDCL command. For CRTCLPGM and CRTCLMOD, any value specified for this parameter is ignored.
Note: If this value is specified, the ACTGRP parameter cannot be specified.
| Top |
Specifies the activation group that the ILE CL program is associated with when it is called. The activation group provides:
Note: This parameter is only applicable if the CL source is compiled using the CRTBNDCL command. For CRTCLPGM and CRTCLMOD, any value specified for this parameter is ignored.
| Top |
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 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.
You can control the activation of each service program. You can specify whether the referenced service program is activated at the same time as the program is being created, or is deferred until a procedure exported from the referenced service program is called. Deferring activation may improve your application's performance.
Note: This parameter is only applicable if the CL source is compiled using the CRTBNDCL command. For CRTCLPGM and CRTCLMOD, any value specified for this parameter is ignored.
Single values
Element 1: Service program
Qualifier 1: Service program
Note: This value should only be specified in a user-controlled environment when you know exactly what is getting bound to your program. Specifying *LIBL with *ALL may give you unpredictable results at program run time. Specify the generic service program name or specific libraries to better control what gets bound to your program.
Qualifier 2: Library
Note: QTEMP is not a valid library name for this parameter.
Element 2: Activation
| Top |
Specifies the list of binding directories that are used in symbol resolution. The exports of the modules and service programs in the binding directory are only checked if there are unresolved module import requests that the exports from the modules and service programs (specified in the MODULE or BNDSRVPGM parameters) could not satisfy. Up to 300 names can be specified.
Note: This parameter is only applicable if the CL source is compiled using the CRTBNDCL command. For CRTCLPGM and CRTCLMOD, any value specified for this parameter is ignored.
Single values
Qualifier 1: Binding directory
Qualifier 2: Library
| Top |
Example 1: Declaring the Subroutine Stack Depth
DCLPRCOPT SUBRSTACK(50)
This command sets the maximum number of subroutine stack entries to 50. When the CL program is run, if the subroutine stack depth exceeds 50, escape message CPF0822 will be sent.
Example 2: Declaring Compiler Options to Override CRTCLPGM
DCLPRCOPT ALWRTVSRC(*NO) USRPRF(*OWNER)
This command will override the Allow RTVCLSRC (ALWRTVSRC) and User profile (USRPRF) values specified on the Create CL Program (CRTCLPGM) command. The resulting CL program will not allow the CL source code to be retrieved from the *PGM object and when the program object is called it will adopt the authorities of the user profile that owns the *PGM object.
Example 3: Declaring Compiler Options to Override CRTCLMOD
DCLPRCOPT LOG(*NO) AUT(*USE)
This command will override the Log commands (LOG) and Authority (AUT) values specified on the CRTCLMOD command. Once the resulting ILE CL module is bound into an ILE program or service program and the ILE CL procedure is called, CL commands run from this procedure will not be logged in the job log. The public authority for the *MODULE object created by the Create CL Module (CRTCLMOD) command will be *USE.
Example 4: Declaring Compiler Options to Override CRTBNDCL
DCLPRCOPT DFTACTGRP(*NO) ACTGRP(MYAPP) +
BNDDIR(MYAPPLIB/MYBNDDIR)
This command will override the Default activation group (DFTACTGRP) and Activation group (ACTGRP) values specified on the Create Bound CL Program (CRTBNDCL) command. The resulting ILE CL program will run in the MYAPP named activation group. When CRTBNDCL runs the Create Program (CRTPGM) command, it will add binding directory MYBNDDIR in library MYAPPLIB on the Binding directory (BINDIR) parameter. This will make the service programs and ILE modules referenced by that binding directory available to resolve ILE procedures used in the ILE CL program.
| Top |
None
| Top |