Skip to content

Commit

Permalink
Merge branch 'master' of github.ibm.com:IBMDBB/PublicSamples
Browse files Browse the repository at this point in the history
  • Loading branch information
drbruce-git committed Nov 5, 2019
2 parents 343b74d + f923da2 commit dc5772a
Show file tree
Hide file tree
Showing 36 changed files with 951 additions and 681 deletions.
41 changes: 29 additions & 12 deletions Build/HelloWorld/hello_asm.groovy
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
import com.ibm.dbb.build.*

// Change the following variables to match your system
hlq = "USER"
sourceDir = "/u/user/build"
macLib = "SYS1.MACLIB"
//userMacLib = "USER.MACLIB" //Uncomment if needed

println("Creating ${hlq}.HASRC. . .")
CreatePDS createPDSCmd = new CreatePDS();
createPDSCmd.setDataset("${hlq}.HASRC");
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
createPDSCmd.create();

println("Creating ${hlq}.HAMOD. . .")
createPDSCmd.setDataset("${hlq}.HAMOD");
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
createPDSCmd.create();

// copy program to PDS
println("Copying hello.asm to USER.HASRC")
new CopyToPDS().file(new File("hello.asm")).dataset("USER.HASRC").member("HELLO").execute()
println("Copying hello.asm to ${hlq}.HASRC")
new CopyToPDS().file(new File("${sourceDir}/hello.asm")).dataset("${hlq}.HASRC").member("HELLO").execute()

// compile the build file
println("Compiling hello.asm")
// assemble the build file
println("Assembling hello.asm")

// define the MVSExec command to compile the file
def compile = new MVSExec().file("hello.asm").pgm("ASMA90").parm("")
def compile = new MVSExec().file("${sourceDir}/hello.asm").pgm("ASMA90").parm("")

// add DD statements to the MVSExec command
compile.dd(new DDStatement().name("SYSIN").dsn("USER.HASRC(HELLO)").options("shr").report(true))
compile.dd(new DDStatement().name("SYSLIN").dsn("USER.HAMOD(HELLO)").options("shr").output(true))
compile.dd(new DDStatement().name("SYSIN").dsn("${hlq}.HASRC(HELLO)").options("shr").report(true))
compile.dd(new DDStatement().name("SYSLIN").dsn("${hlq}.HAMOD(HELLO)").options("shr").output(true))
compile.dd(new DDStatement().name("SYSPRINT").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT1").options("cyl space(5,5) unit(vio) new"))

// add a syslib to the compile command with optional CICS concatenation
compile.dd(new DDStatement().name("SYSLIB").dsn("USER.HAMAC").options("shr"))
compile.dd(new DDStatement().dsn("SYS1.MACLIB").options("shr"))
compile.dd(new DDStatement().name("SYSLIB").dsn("${macLib}").options("shr"))
//compile.dd(new DDStatement().dsn("${userMacLib}").options("shr")) //Uncomment if user maclib needed

// log
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("/u/user/build/hello.log")))
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("${sourceDir}/hello_asm.log")))

// execute the MVSExec compile command
def rc = compile.execute()

if (rc > 4)
println("Compile failed! RC=$rc")
println("Assembly failed! RC=$rc")
else
println("Compile successful! RC=$rc")
println("Assembly successful! RC=$rc")
52 changes: 28 additions & 24 deletions Build/HelloWorld/hello_cbl.groovy
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
import com.ibm.dbb.build.*

println("Copying /u/usr1/build/hello.cbl to USR1.BUILD.COBOL(HELLO) . . .")
def copy = new CopyToPDS().file(new File("/u/usr1/build/hello.cbl")).dataset("USR1.BUILD.COBOL").member("HELLO")
// Change the following variables to match your system
hlq = "USER.BUILD"
sourceDir = "/u/user/build"
compilerDS = "IGY.V6R1M0.SIGYCOMP"

println("Creating ${hlq}.COBOL. . .")
CreatePDS createPDSCmd = new CreatePDS();
createPDSCmd.setDataset("${hlq}.COBOL");
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
createPDSCmd.create();

println("Creating ${hlq}.OBJ. . .")
createPDSCmd.setDataset("${hlq}.OBJ");
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
createPDSCmd.create();

println("Copying ${sourceDir}/hello.cbl to ${hlq}.COBOL(HELLO) . . .")
def copy = new CopyToPDS().file(new File("${sourceDir}/hello.cbl")).dataset("${hlq}.COBOL").member("HELLO")
copy.execute()

println("Compiling USR1.BUILD.COBOL(HELLO). . .")
println("Compiling ${hlq}.COBOL(HELLO). . .")
def compile = new MVSExec().pgm("IGYCRCTL").parm("LIB")
compile.dd(new DDStatement().name("SYSIN").dsn("USR1.BUILD.COBOL(HELLO)").options("shr"))
compile.dd(new DDStatement().name("SYSLIN").dsn("USR1.BUILD.OBJ(HELLO)").options("shr"))
compile.dd(new DDStatement().name("SYSUT1").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT2").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT3").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT4").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT5").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT6").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT7").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT8").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT9").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT10").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT11").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT12").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT13").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT14").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT15").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT16").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSUT17").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSIN").dsn("${hlq}.COBOL(HELLO)").options("shr"))
compile.dd(new DDStatement().name("SYSLIN").dsn("${hlq}.OBJ(HELLO)").options("shr"))

(1..17).toList().each { num ->
compile.dd(new DDStatement().name("SYSUT$num").options("cyl space(5,5) unit(vio) new"))
}

compile.dd(new DDStatement().name("SYSMDECK").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("TASKLIB").dsn("IGY.V6R1M0.SIGYCOMP").options("shr"))
compile.dd(new DDStatement().name("TASKLIB").dsn("${compilerDS}").options("shr"))
compile.dd(new DDStatement().name("SYSPRINT").options("cyl space(5,5) unit(vio) new"))
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("/u/usr1/build/hello.log")))
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("${sourceDir}/hello_cbl.log")))
def rc = compile.execute()

if (rc > 4)
Expand Down
30 changes: 23 additions & 7 deletions Build/HelloWorld/hello_pli.groovy
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
import com.ibm.dbb.build.*

println("Copying /u/usr1/build/hello.pli to USR1.BUILD.PLI(HELLO) . . .")
def copy = new CopyToPDS().file(new File("/u/usr1/build/hello.pli")).dataset("USR1.BUILD.PLI").member("HELLO")
// Change the following variables to match your system
hlq = "USER.BUILD"
sourceDir = "/u/user/build"
compilerDS = "IBMZ.V5R2M0.SIBMZCMP"

println("Creating ${hlq}.PLI. . .")
CreatePDS createPDSCmd = new CreatePDS();
createPDSCmd.setDataset("${hlq}.PLI");
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
createPDSCmd.create();

println("Creating ${hlq}.OBJ. . .")
createPDSCmd.setDataset("${hlq}.OBJ");
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
createPDSCmd.create();

println("Copying ${sourceDir}/hello.pli to ${hlq}.PLI(HELLO) . . .")
def copy = new CopyToPDS().file(new File("${sourceDir}/hello.pli")).dataset("${hlq}.PLI").member("HELLO")
copy.execute()

println("Compiling USR1.BUILD.PLI(HELLO). . .")
println("Compiling ${hlq}.PLI(HELLO). . .")
def compile = new MVSExec().pgm("IBMZPLI").parm("SOURCE")
compile.dd(new DDStatement().name("SYSIN").dsn("USR1.BUILD.PLI(HELLO)").options("shr"))
compile.dd(new DDStatement().name("SYSLIN").dsn("USR1.BUILD.OBJ(HELLO)").options("shr"))
compile.dd(new DDStatement().name("SYSIN").dsn("${hlq}.PLI(HELLO)").options("shr"))
compile.dd(new DDStatement().name("SYSLIN").dsn("${hlq}.OBJ(HELLO)").options("shr"))
compile.dd(new DDStatement().name("SYSUT1").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSTERM").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSPUNCH").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("SYSOUT").options("cyl space(5,5) unit(vio) new"))
compile.dd(new DDStatement().name("TASKLIB").dsn("IBMZ.V5R2M0.SIBMZCMP").options("shr"))
compile.dd(new DDStatement().name("TASKLIB").dsn("${compilerDS}").options("shr"))
compile.dd(new DDStatement().name("SYSPRINT").options("cyl space(5,5) unit(vio) new"))
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("/u/usr1/build/hello_pli.log")))
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("${sourceDir}/hello_pli.log")))
def rc = compile.execute()

if (rc > 4)
Expand Down
8 changes: 6 additions & 2 deletions Build/MortgageApplication/build/Tools.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def parseArgs(String[] cliArgs, String usage) {
def loadProperties(OptionAccessor opts) {
// check to see if there is a ./build.properties to load
def properties = BuildProperties.getInstance()
def buildPropFile = new File("${getScriptDir()}/build.yaml")
// One may also use YAML files as an alternative to properties files (DBB 1.0.6 and later):
// def buildPropFile = new File("${getScriptDir()}/build.yaml")
def buildPropFile = new File("${getScriptDir()}/build.properties")
if (buildPropFile.exists())
BuildProperties.load(buildPropFile)

Expand Down Expand Up @@ -79,7 +81,9 @@ def loadProperties(OptionAccessor opts) {
// load datasets.properties containing system specific PDS names used by Mortgage Application build
properties.load(new File("${getScriptDir()}/datasets.properties"))
// load file.properties containing file specific properties like script mappings and CICS/DB2 content flags
properties.load(new File("${getScriptDir()}/file.yaml"))
// One may also use YAML files as an alternative to properties files (DBB 1.0.6 and later):
// properties.load(new File("${getScriptDir()}/file.yaml"))
properties.load(new File("${getScriptDir()}/file.properties"))
// load bind.properties containing DB2 BIND PACKAGE parameters used by Mortgage Application build
properties.load(new File("${getScriptDir()}/bind.properties"))
// load bindlinkEditScanner.properties containing Link Edit scanning options used by Mortgage Application build
Expand Down
2 changes: 2 additions & 0 deletions Build/zAppBuild/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ build options:
-r,--reset Deletes the application's dependency collections
and build result group from the DBB repository
-v,--verbose Flag to turn on script trace
-d,--debug Flag to build modules for debugging with
IBM Debug for z/OS
-l,--logEncoding <arg> Encoding of output logs. Default is EBCDIC
web application credentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ assembler_fileBuildRank=
# can be overridden by file properties
assembler_pgmParms=LIST
assembler_linkEditParms=MAP,RENT,COMPAT(PM5)
assembler_compileErrorPrefixParms=ADATA,EX(ADX(ELAXHASM))

#
# execute link edit step
Expand Down
14 changes: 14 additions & 0 deletions Build/zAppBuild/application/application-conf/Cobol.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,25 @@ cobol_compileCICSParms=CICS
cobol_compileSQLParms=SQL
cobol_compileErrorPrefixParms=ADATA,EX(ADX(ELAXMGUX))

# Compile Options for IBM Debugger. Assuming to keep Dwarf Files inside the load.
# If you would like to separate debug info, additional allocations needed (See COBOL + Debugger libraries)
cobol_compileDebugParms=TEST

#
# default LinkEdit parameters
# can be overridden by file properties
cobol_linkEditParms=MAP,RENT,COMPAT(PM5)

# If you would like to have a physical link card, we generated it for you given the below pattern
# This property has priority over cobol_linkDebugExit
# cobol_linkEditStream= INCLUDE OBJECT(@{member})
cobol_linkEditStream=

# If using a debug exit, provide the SYSLIN instream DD
# Samp: cobol_linkDebugExit= INCLUDE OBJECT(@{member}) \n INCLUDE SYSLIB(EQAD3CXT)
cobol_linkDebugExit= INCLUDE OBJECT(@{member}) \n INCLUDE SYSLIB(EQAD3CXT)


#
# execute link edit step
# can be overridden by file properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pli_linkEditMaxRC=0
pli_compileParms=PP(INCLUDE('ID(++INCLUDE)'))
pli_compileCICSParms=SYSTEM(CICS),PP(MACRO,CICS)
pli_compileSQLParms=PP(SQL)
pli_compileErrorPrefixParms=ADATA,EX(ADX(ELAXMGUX))
pli_compileErrorPrefixParms=XINFO(XML)

#
# default LinkEdit parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Comma separated list of additional application property files to load
# Supports both relative path (to ${application}/application-conf/) and absolute path
applicationPropFiles=file.properties,bind.properties,Assembler.properties,BMS.properties,Cobol.properties,LinkEdit.properties,PLI.properties
applicationPropFiles=file.properties,bind.properties,Assembler.properties,BMS.properties,Cobol.properties,LinkEdit.properties,bind.properties,PLI.properties

#
# Comma separated list all source directories included in application build. Supports both absolute
Expand Down
14 changes: 7 additions & 7 deletions Build/zAppBuild/application/application-conf/bind.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
bind_maxRC=4

# Flag indicating to run DB2 BIND PACKAGE. Set to 'true' to bind SQL programs
RUN_DB2_BIND = false
bind_performBindPackage=false

# DBB Toolkit conf (configuration) directory location on zFS. Default value is preset
# This directory may have been relocated to a writable disk by your SYSADMIN
CONFDIR =
bind_runIspfConfDir=

# Specify the name of the DB2 subsystem
SUBSYS =
bind_db2Location=

# Specify the DB2 collection (Package)
COLLID =
bind_collectionID=

# Specify the owner of the package
OWNER =
# Specify the owner of the package, if empty user.name will be used
bind_packageOwner=

# Specify the value of the implicit qualifier.
QUAL =
bind_qualifier=
5 changes: 4 additions & 1 deletion Build/zAppBuild/build-conf/Assembler.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ assembler_loadOptions=cyl space(1,1) dsorg(PO) recfm(U) blksize(32760) dsntype(l

assembler_tempOptions=cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new

# Allocation of SYSMLSD Dataset used for extracting Compile Messages to Remote Error List
assembler_compileErrorFeedbackXmlOptions=tracks space(200,40) dsorg(PS) blksize(27998) lrecl(16383) recfm(v,b) new keep

#
# default assembler properties
assembler_pgm=ASMA90
assembler_linkEditor=IEWBLINK

# ASM scanner language hint
dbb.DependencyScanner.languageHint=ASM :: **/*.asm, **/*.mac
dbb.DependencyScanner.languageHint=ASM :: **/*.asm, **/*.mac
3 changes: 3 additions & 0 deletions Build/zAppBuild/build-conf/Cobol.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ cobol_loadOptions=cyl space(1,1) dsorg(PO) recfm(U) blksize(32760) dsntype(libra
cobol_tempOptions=cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new
cobol_printTempOptions=cyl space(5,5) unit(vio) blksize(133) lrecl(133) recfm(f,b) new

# Allocation of SYSMLSD Dataset used for extracting Compile Messages to Remote Error List
cobol_compileErrorFeedbackXmlOptions=tracks space(200,40) dsorg(PS) blksize(27998) lrecl(16383) recfm(v,b) new keep

#
# COBOL scanner language hint
dbb.DependencyScanner.languageHint=COB :: **/*.cbl, **/*.cpy
Expand Down
5 changes: 4 additions & 1 deletion Build/zAppBuild/build-conf/PLI.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ pli_loadOptions=cyl space(1,1) dsorg(PO) recfm(U) blksize(32760) dsntype(library
pli_tempOptions=cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new
pli_listOptions=cyl space(5,5) unit(vio) blksize(0) lrecl(137) recfm(v,b) new

# Allocation of SYSMLSD Dataset used for extracting Compile Messages to Remote Error List
pli_compileErrorFeedbackXmlOptions=tracks space(200,40) dsorg(PS) blksize(27998) lrecl(16383) recfm(v,b) new keep

#
# PL/I scanner language hint
dbb.DependencyScanner.languageHint=PLI :: **/*.pli, **/*.inc, **/*.cpy
dbb.DependencyScanner.languageHint=PLI :: **/*.pli, **/*.inc, **/*.cpy
20 changes: 20 additions & 0 deletions Build/zAppBuild/build-conf/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,29 @@ dbb.RepositoryClient.userId=ADMIN
# build.groovy option -pf, --pf
dbb.RepositoryClient.passwordFile=${zAppBuildDir}/utilities/ADMIN.pw

# The dbb.gateway.type property determines which gateway type is used for the entire build process
# Possible values are 'legacy' and 'interactive. Default if not indicated is 'legacy'
dbb.gateway.type=legacy

# Procedure Name - specified with the procname parameter
dbb.gateway.procedureName=

# Account number - specified with the acctnum parameter
dbb.gateway.accountNumber=

# Group name - specified with a groupid parameter
dbb.gateway.groupId=

# Region size - specified with the regionsz parameter
dbb.gateway.regionSize=

# Gateway logging level. Add values for multiple types:
# 1 - Log error information
# 2 - Log debug information
# 4 - Log communication information
# 8 - Log time information
# 16 - Log information to the system console
dbb.gateway.logLevel=



Expand Down
3 changes: 3 additions & 0 deletions Build/zAppBuild/build-conf/datasets.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ SCSQLOAD=
# DB2 Load Library. Example: DB2.V9R1M0.SDSNLOAD
SDSNLOAD=

# IBM Debug Library containing Exits
SEQAMOD=

# Optional IDz Load Library. Example: FEL.V14R0M0.SFELLOAD
SFELLOAD=
6 changes: 6 additions & 0 deletions Build/zAppBuild/build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ options:
cli.wrkDir(longOpt:'workDir', args:1, 'Absolute path to the build output root directory for user build')
cli.t(longOpt:'team', args:1, argName:'hlq', 'Team build hlq for user build syslib concatenations')

// debug option
cli.d(longOpt:'debug', 'Flag to indicate a build for debugging')

// utility options
cli.help(longOpt:'help', 'Prints this message')

Expand Down Expand Up @@ -282,6 +285,9 @@ def populateBuildProperties(String[] args) {
if (opts.pw) props.pw = opts.pw
if (opts.pf) props.pf = opts.pf

// set debug flag
if(opts.d) props.debug = 'true'

// set DBB configuration properties
if (opts.url) props.'dbb.RepositoryClient.url' = opts.url
if (opts.id) props.'dbb.RepositoryClient.userId' = opts.id
Expand Down
Loading

0 comments on commit dc5772a

Please sign in to comment.