Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Db2 bind package and plan for Assembler and PLI #583

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions languages/Assembler.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.ibm.dbb.build.report.records.*
@Field BuildProperties props = BuildProperties.getInstance()
@Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy"))
@Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy"))
@Field def bindUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BindUtilities.groovy"))

println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script")

Expand Down Expand Up @@ -157,6 +158,35 @@ sortedList.each { buildFile ->
}
}
}

//perform Db2 binds on userbuild
if (rc <= maxRC && buildUtils.isSQL(logicalFile) && props.userBuild) {
//perform Db2 Bind Pkg
bind_performBindPackage = props.getFileProperty('bind_performBindPackage', buildFile)
if (bind_performBindPackage && bind_performBindPackage.toBoolean()) {
int bindMaxRC = props.getFileProperty('bind_maxRC', buildFile).toInteger()
def (bindRc, bindLogFile) = bindUtils.bindPackage(buildFile, props.assembler_dbrmPDS);
if ( bindRc > bindMaxRC) {
String errorMsg = "*! The bind package return code ($bindRc) for $buildFile exceeded the maximum return code allowed ($props.bind_maxRC)"
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg,logs:["${member}_bind_pkg.log":bindLogFile])
}
}

//perform Db2 Bind Plan
bind_performBindPlan = props.getFileProperty('bind_performBindPlan', buildFile)
if (bind_performBindPlan && bind_performBindPlan.toBoolean()) {
int bindMaxRC = props.getFileProperty('bind_maxRC', buildFile).toInteger()
def (bindRc, bindLogFile) = bindUtils.bindPlan(buildFile);
if ( bindRc > bindMaxRC) {
String errorMsg = "*! The bind plan return code ($bindRc) for $buildFile exceeded the maximum return code allowed ($props.bind_maxRC)"
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg,logs:["${member}_bind_plan.log":bindLogFile])
}
}
}

// clean up passed DD statements
job.stop()
Expand Down
51 changes: 26 additions & 25 deletions languages/Cobol.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ sortedList.each { buildFile ->
int rc = compile.execute()
int maxRC = props.getFileProperty('cobol_compileMaxRC', buildFile).toInteger()

boolean bindFlag = true

if (rc > maxRC) {
bindFlag = false
String errorMsg = "*! The compile return code ($rc) for $buildFile exceeded the maximum return code allowed ($maxRC)"
Expand All @@ -99,7 +97,6 @@ sortedList.each { buildFile ->
maxRC = props.getFileProperty('cobol_linkEditMaxRC', buildFile).toInteger()

if (rc > maxRC) {
bindFlag = false
String errorMsg = "*! The link edit return code ($rc) for $buildFile exceeded the maximum return code allowed ($maxRC)"
println(errorMsg)
props.error = "true"
Expand All @@ -116,29 +113,33 @@ sortedList.each { buildFile ->
}
}

//perform Db2 Bind Pkg only on User Build and perfromBindPackage property
bind_performBindPackage = props.getFileProperty('bind_performBindPackage', buildFile)
if (props.userBuild && bindFlag && logicalFile.isSQL() && bind_performBindPackage && bind_performBindPackage.toBoolean()) {
int bindMaxRC = props.getFileProperty('bind_maxRC', buildFile).toInteger()
def (bindRc, bindLogFile) = bindUtils.bindPackage(buildFile, props.cobol_dbrmPDS);
if ( bindRc > bindMaxRC) {
String errorMsg = "*! The bind package return code ($bindRc) for $buildFile exceeded the maximum return code allowed ($props.bind_maxRC)"
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg,logs:["${member}_bind_pkg.log":bindLogFile])
//perform Db2 binds on userbuild
if (rc <= maxRC && buildUtils.isSQL(logicalFile) && props.userBuild) {

//perform Db2 Bind Pkg
bind_performBindPackage = props.getFileProperty('bind_performBindPackage', buildFile)
if ( bind_performBindPackage && bind_performBindPackage.toBoolean()) {
int bindMaxRC = props.getFileProperty('bind_maxRC', buildFile).toInteger()
def (bindRc, bindLogFile) = bindUtils.bindPackage(buildFile, props.cobol_dbrmPDS);
if ( bindRc > bindMaxRC) {
String errorMsg = "*! The bind package return code ($bindRc) for $buildFile exceeded the maximum return code allowed ($props.bind_maxRC)"
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg,logs:["${member}_bind_pkg.log":bindLogFile])
}
}
}

//perform Db2 Bind Pkg only on User Build and perfromBindPackage property
bind_performBindPlan = props.getFileProperty('bind_performBindPlan', buildFile)
if (props.userBuild && bindFlag && logicalFile.isSQL() && bind_performBindPlan && bind_performBindPlan.toBoolean()) {
int bindMaxRC = props.getFileProperty('bind_maxRC', buildFile).toInteger()
def (bindRc, bindLogFile) = bindUtils.bindPlan(buildFile);
if ( bindRc > bindMaxRC) {
String errorMsg = "*! The bind plan return code ($bindRc) for $buildFile exceeded the maximum return code allowed ($props.bind_maxRC)"
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg,logs:["${member}_bind_plan.log":bindLogFile])

//perform Db2 Bind Plan
bind_performBindPlan = props.getFileProperty('bind_performBindPlan', buildFile)
if (bind_performBindPlan && bind_performBindPlan.toBoolean()) {
int bindMaxRC = props.getFileProperty('bind_maxRC', buildFile).toInteger()
def (bindRc, bindLogFile) = bindUtils.bindPlan(buildFile);
if ( bindRc > bindMaxRC) {
String errorMsg = "*! The bind plan return code ($bindRc) for $buildFile exceeded the maximum return code allowed ($props.bind_maxRC)"
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg,logs:["${member}_bind_plan.log":bindLogFile])
}
}
}

Expand Down
33 changes: 32 additions & 1 deletion languages/PLI.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.ibm.dbb.build.report.records.*
@Field BuildProperties props = BuildProperties.getInstance()
@Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy"))
@Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy"))
@Field def bindUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BindUtilities.groovy"))

println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script")

Expand Down Expand Up @@ -74,7 +75,7 @@ sortedList.each { buildFile ->
// compile the program
int rc = compile.execute()
int maxRC = props.getFileProperty('pli_compileMaxRC', buildFile).toInteger()

if (rc > maxRC) {
String errorMsg = "*! The compile return code ($rc) for $buildFile exceeded the maximum return code allowed ($maxRC)"
println(errorMsg)
Expand Down Expand Up @@ -110,6 +111,36 @@ sortedList.each { buildFile ->
}
}
}

//perform Db2 binds on userbuild
if (rc <= maxRC && buildUtils.isSQL(logicalFile) && props.userBuild) {

//perform Db2 Bind Pkg
bind_performBindPackage = props.getFileProperty('bind_performBindPackage', buildFile)
if (bind_performBindPackage && bind_performBindPackage.toBoolean()) {
int bindMaxRC = props.getFileProperty('bind_maxRC', buildFile).toInteger()
def (bindRc, bindLogFile) = bindUtils.bindPackage(buildFile, props.pli_dbrmPDS);
if ( bindRc > bindMaxRC) {
String errorMsg = "*! The bind package return code ($bindRc) for $buildFile exceeded the maximum return code allowed ($props.bind_maxRC)"
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg,logs:["${member}_bind_pkg.log":bindLogFile])
}
}

//perform Db2 Bind plan
bind_performBindPlan = props.getFileProperty('bind_performBindPlan', buildFile)
if (bind_performBindPlan && bind_performBindPlan.toBoolean()) {
int bindMaxRC = props.getFileProperty('bind_maxRC', buildFile).toInteger()
def (bindRc, bindLogFile) = bindUtils.bindPlan(buildFile);
if ( bindRc > bindMaxRC) {
String errorMsg = "*! The bind plan return code ($bindRc) for $buildFile exceeded the maximum return code allowed ($props.bind_maxRC)"
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg,logs:["${member}_bind_plan.log":bindLogFile])
}
}
}
}
// clean up passed DD statements
job.stop()
Expand Down