Setting create options in the CL source program

With the Declare Processing Options (DCLPRCOPT) command, you can set many of the same create option parameters that are on the CL compiler commands. The CL compiler commands include Create CL Program (CRTCLPGM), Create CL Module (CRTCLMOD), and Create Bound CL Program (CRTBNDCL).

Values specified on the DCLPRCOPT command take precedence over any values specified on the CL compiler commands. In addition, the DCLPRCOPT command supports the Binding directory (BNDDIR) and Binding service program (BNDSRVPGM) parameters that can be used when running the CRTBNDCL command. The following examples show how the DCLPRCOPT command can be used:

Example: Declaring compiler options to override CRTCLPGM

DCLPRCOPT    ALWRTVSRC(*NO)  USRPRF(*OWNER)

This command overrides the Allow RTVCLSRC (ALWRTVSRC) and User profile (USRPRF) parameter values that are specified on the CRTCLPGM command. The resulting CL program does not allow the CL source code to be retrieved from the *PGM object. When the program object is called, it adopts the authorities of the user profile that owns the *PGM object.

Example: Declaring compiler options to override CRTCLMOD

DCLPRCOPT    LOG(*NO)  AUT(*USE)

This command overrides the Log commands (LOG) and Authority (AUT) parameter values that are specified on the CRTCLMOD command. When the resulting ILE CL module is bound into an ILE program or service program and the ILE CL procedure is called, CL commands that run from this procedure are not logged in the job log. The public authority for the *MODULE object that is created by the CRTCLMOD command is *USE.

Example: Declaring compiler options to override CRTBNDCL

Start of change
DCLPRCOPT    ALWRTVSRC(*NO)  DFTACTGRP(*NO)  ACTGRP(MYAPP)  +
             BNDDIR(MYAPPLIB/MYBNDDIR)
End of change

Start of changeThis command overrides the Allow RTVCLSRC (ALWRTVSRC), Default activation group (DFTACTGRP), Activation group (ACTGRP), and Binding directory (BNDDIR) parameter values that are specified on the CRTBNDCL command. The resulting ILE CL program does not contain CL source that can be retrieved using the RTVCLSRC command. The program runs in the activation group named MYAPP. When the CRTPGM command is used to create the bound CL program, the CRTBNDCL command adds binding directory MYBNDDIR in library MYAPPLIB to the Binding directory (BNDDIR) parameter. In this way, the service programs and ILE modules that are referenced by that binding directory can be used to resolve ILE procedures used in the ILE CL program. End of change