Language task: Db2Binds.yaml

Description

This sample provides the language task configuration to perform a Db2 bind for the MortgageApplication sample. It is imported via Languages.yaml.

Actions

  • Check start conditions.
  • Define sources.
  • Define variables.
  • Create datasets.
  • Loop through steps for each build file.
    • Execute the Db2 bind package.
    • Execute the Db2 bind plan.

Check start conditions

Db2 Bind is designed only to run during a user build, otherwise it must be skipped.

condition:
  exists: ${userbuild}
  eval: ( ${userbuild} == true ) && ( ${STATUS} == 0 )

Define sources

Define sources as a list of file patterns to locate COBOL testcases within the build list.

sources:
  - "**/cobol/*.cbl"

Task variables

Required variables

performBindPackage

Type: boolean
Default: false
Flag indicating whether to run DB2 BIND PACKAGE. Set to true to bind SQL programs can be overridden by application variables.

performBindPlan

Type: boolean
Default: false
Flag indicating to run DB2 BIND PLAN. Set to true to bind SQL programs can be overridden by application variables.

jobCard

Type: String
Default:

//BINDPKG JOB 'DBB-PKGBIND',  
// MSGLEVEL=(1,1),MSGCLASS=R,NOTIFY=&SYSUID

Bind the job card for the JCL that is generated. Note the use of a pipe symbol (|) to indicate that the text should maintain newline characters.

Optional variables

The following should be set via the application variables.

db2Location

Type: String
The name of the DB2 subsystem.

collectionID

Type: String
The DB2 collection (Package).

plan

Type: String
The DB2 Plan name.

plan_pklist

Type: String
Example: *.MORTAGE.* The DB2 Plan pklist.

packageOwner

Type: String The owner of the package.

qualifier

Type: String
The value of the implicit qualifier.

Create datasets

Create the dataset which must exist and be validated prior to compile.

datasets:
  - name: ${HLQ}.DBRM
    options: cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)

Task steps

For each build file, the following steps will be executed.

Execute bind package

The job step bindPackage submits the JCL job to execute the Db2 Bind Package. This step is conditionally executed when the COBOL file is scanned or marked as SQL, and variable performBindPackage is true.

- step: bindPackage
  condition: ${IS_SQL} && ${performBindPackage}
  comment: Executing Db2 bind package for ${MEMBER}
  type: job
  maxRC: 4
  logs:
    - log: ${LOGS}/${MEMBER}_bind_pkg.log
      ddname: "*"
  text: |
    ${jobCard}
    //*
    //**PKGBIND
    //PKGBIND EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)
    //STEPLIB  DD  DSN=${SDSNLOAD},DISP=SHR
    //SYSTSPRT DD SYSOUT=*
    //SYSPRINT DD SYSOUT=*
    //SYSUDUMP DD SYSOUT=*
    //SYSIN DD DUMMY
    //SYSTSIN DD *
    DSN SYSTEM(${db2Location})                                       
    BIND PACKAGE(${collectionID})   +                                
         MEMBER(${MEMBER})          +                                
         LIBRARY('${HLQ}.DBRM')     +                                
         OWNER(${packageOwner})     +                                
         QUALIFIER(${qualifier})    +                                
         ACTION(REPLACE)            +                                
         ISOLATION(CS)                                        
    END  
    //

Execute bind plan

The job step bindPlan submits the JCL job to execute the Db2 Bind Plan.

- step: bindPlan
  condition: ${IS_SQL} && ${performBindPlan}
  comment: Executing Db2 bind plan for ${plan}
  type: job
  maxRC: 4
  logs:
    - log: ${LOGS}/${plan}_bind_plan.log
      ddname: "*"
  text: |
    ${jobCard}
    //*
    //**PLNBIND
    //PLNBIND EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)
    //STEPLIB  DD  DSN=${SDSNLOAD},DISP=SHR
    //SYSTSPRT DD SYSOUT=*
    //SYSPRINT DD SYSOUT=*
    //SYSUDUMP DD SYSOUT=*
    //SYSIN DD DUMMY
    //SYSTSIN DD *
    DSN SYSTEM(${db2Location})                                       
    BIND PLAN(${plan})              +                                
         PKLIST(${plan_pklist})     +                                
         OWNER(${packageOwner})     +                                
         QUALIFIER(${qualifier})    +                                
         ACTION(REPLACE)            +                                
         ISOLATION(CS)              +
         RELEASE(COMMIT)            +
         ENCODING(EBCDIC)                                      
    END  
    //