CMNDB2PL Operation
This section describes how Plan Lookup program CMNDB2PL operates and the factors and variables that can influence the way it works when building bind control for a Db2 Option logical subsystem. The sequence of operations presented here is not exactly the order that the program performs every function.
-
The control statements at ddname CMNPLCTL are scanned to validate the syntax. If an error is found, the program ends with RC=12, and this message is displayed: CMN7005I Control Card Error
-
BIND PLAN members listed in ddname CMNPLDBB and BIND PACKAGE members listed in ddname CMNPLPKG are added to “plans to be bound” list. Each entry in this list is flagged with the assigned library type.
-
CMNDB2PL attempts to add BIND PLAN member names and BIND PACKAGE member names to the “plans to be bound” list for all DBRM members listed in ddname CMNPLDBR. This process is traced for one DBRM to make it easier to understand.
-
If control statement USEDB2PACKAGE is present, program CMNDB2PL queries the Db2 catalog table SYSIBM.SYSPACKAGE to find packages that reference the DBRM. If a package name is returned from the query, the program name is matched against member names in libraries concatenated at ddnames PKGSSTG and PKGSBAS. If a match is found, the program name is added to the “plans to be bound list”.
-
If control statement NODB2PLAN is omitted or commented out, program CMNDB2PL queries the Db2 catalog table SYSIBM.SYSDBRM to find plans that reference the DBRM. The SYSIBM.SYSDBRM query returns the names of all plans referencing the DBRM. However, CMNDB2PL only wants those plans from the Db2 catalog that are associated with the target logical subsystem. It applies the template for the target logical subsystem to the member names in libraries concatenated at ddnames DBBSSTG and DBBSBAS. If a templated plan name matches a plan name returned from the Db2 catalog query, the untemplated plan name is added to the “plans to be bound” list.
-
If no BIND PACKAGE member name or templated BIND PLAN name matches the names returned from the Db2 catalog scans, the name of the DBRM is added to a “bind statement required list”.
-
-
If the “plans to be bound” list is empty, and control statement NODBRMFOUND is omitted or commented out, CMNDB2PL stops with a RC=12 and the message, NO PLANS HAVE BEEN FOUND TO BIND is printed.
-
The output ddname stssysBCTL for the sequential BIND command file is opened and command DSN SYSTEM(stssys) is written as the first record.
-
If the “plans to be bound” list is not empty, duplicates are removed from the list, and each remaining name in the list is processed individually. The libraries concatenated at ddnames DBBSSTG and DBBSBAS or at PKGSSTG and PKGSBAS are searched for the first member name that matches a name on the “plans to be bound list”.
-
If a match is found, the BIND command member is read, and templates for the target logical subsystem are applied. Unless control statement USEREXIT=(NONE) is input, a call is made to exit program CMNEX101, where user written functions can further modify the BIND command. The modified BIND command is written to the sequential file at ddname syssysBCTL to be used in a subsequent bind job step.
-
If no match is found, and if control statements CREATECC and USEREXIT are input to CMNDB2PL, exit program CMNEX101 is called to execute user written functions to create an appropriate BIND command. The new BIND command is written to the sequential file at ddname stssysBCTL to be used in a subsequent bind job step.
-
If no match is found, and control statement CREATECC is not input to CMNDB2PL, the name is added to a “not found list”, and at the end processing, CMNDB2PL displays this list as “Bind statements required.” If a BIND member is not found for promote or install, a return code 12 is issued with the message:
CMN7011I CMNDB2PL is terminating due to errors
-
If a member is not found for demote or backout, and the Db2 source program is not “new”, a return code 12 is issued unless a different return code is specified on control statement NOBASEDBBRC.
-
-
An END command is written to ddname stssysBCTL as the last records and the file is closed. This file of BIND commands is passed to a job step the performs the binds.
-
The file at ddname stssysBCTL is scanned to ensure that every staged DBRM is referenced by a MEMBER statement in a BIND command. If there is a DBRM that is not referenced, CMNDBRPL terminates with RC=12 and issues this message:
CMN7034A Staged DBRM {dbrm name} is not referenced by any plans
You can suppress this return code and error message by using CMNDB2PL control statement IGNORENODBRM.
BIND Command Keyword Option Order
Important
BIND Command Keyword Option Order CMNDB2PL uses IBM service routine IKJPARS to parse BIND commands. This ensures that Db2 Option processing is synchronized with changes that IBM might make to BIND keyword operands.
IKJPARS does not attempt to maintain the input order of keyword operands that it parses. Therefore, keyword operands in a BIND command that CMNDB2PL sends to exit programs CMNEX101, CMNEX103, and finally to IKJEFT01 may be in a different order than in the original BIND command member in a staging, promotion, baseline, or production library.