Skip to content

Commit dc5772a

Browse files
committed
Merge branch 'master' of github.ibm.com:IBMDBB/PublicSamples
2 parents 343b74d + f923da2 commit dc5772a

36 files changed

+951
-681
lines changed

Build/HelloWorld/hello_asm.groovy

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
11
import com.ibm.dbb.build.*
22

3+
// Change the following variables to match your system
4+
hlq = "USER"
5+
sourceDir = "/u/user/build"
6+
macLib = "SYS1.MACLIB"
7+
//userMacLib = "USER.MACLIB" //Uncomment if needed
8+
9+
println("Creating ${hlq}.HASRC. . .")
10+
CreatePDS createPDSCmd = new CreatePDS();
11+
createPDSCmd.setDataset("${hlq}.HASRC");
12+
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
13+
createPDSCmd.create();
14+
15+
println("Creating ${hlq}.HAMOD. . .")
16+
createPDSCmd.setDataset("${hlq}.HAMOD");
17+
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
18+
createPDSCmd.create();
19+
320
// copy program to PDS
4-
println("Copying hello.asm to USER.HASRC")
5-
new CopyToPDS().file(new File("hello.asm")).dataset("USER.HASRC").member("HELLO").execute()
21+
println("Copying hello.asm to ${hlq}.HASRC")
22+
new CopyToPDS().file(new File("${sourceDir}/hello.asm")).dataset("${hlq}.HASRC").member("HELLO").execute()
623

7-
// compile the build file
8-
println("Compiling hello.asm")
24+
// assemble the build file
25+
println("Assembling hello.asm")
926

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

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

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

2340
// log
24-
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("/u/user/build/hello.log")))
41+
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("${sourceDir}/hello_asm.log")))
2542

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

2946
if (rc > 4)
30-
println("Compile failed! RC=$rc")
47+
println("Assembly failed! RC=$rc")
3148
else
32-
println("Compile successful! RC=$rc")
49+
println("Assembly successful! RC=$rc")

Build/HelloWorld/hello_cbl.groovy

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
import com.ibm.dbb.build.*
22

3-
println("Copying /u/usr1/build/hello.cbl to USR1.BUILD.COBOL(HELLO) . . .")
4-
def copy = new CopyToPDS().file(new File("/u/usr1/build/hello.cbl")).dataset("USR1.BUILD.COBOL").member("HELLO")
3+
// Change the following variables to match your system
4+
hlq = "USER.BUILD"
5+
sourceDir = "/u/user/build"
6+
compilerDS = "IGY.V6R1M0.SIGYCOMP"
7+
8+
println("Creating ${hlq}.COBOL. . .")
9+
CreatePDS createPDSCmd = new CreatePDS();
10+
createPDSCmd.setDataset("${hlq}.COBOL");
11+
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
12+
createPDSCmd.create();
13+
14+
println("Creating ${hlq}.OBJ. . .")
15+
createPDSCmd.setDataset("${hlq}.OBJ");
16+
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
17+
createPDSCmd.create();
18+
19+
println("Copying ${sourceDir}/hello.cbl to ${hlq}.COBOL(HELLO) . . .")
20+
def copy = new CopyToPDS().file(new File("${sourceDir}/hello.cbl")).dataset("${hlq}.COBOL").member("HELLO")
521
copy.execute()
622

7-
println("Compiling USR1.BUILD.COBOL(HELLO). . .")
23+
println("Compiling ${hlq}.COBOL(HELLO). . .")
824
def compile = new MVSExec().pgm("IGYCRCTL").parm("LIB")
9-
compile.dd(new DDStatement().name("SYSIN").dsn("USR1.BUILD.COBOL(HELLO)").options("shr"))
10-
compile.dd(new DDStatement().name("SYSLIN").dsn("USR1.BUILD.OBJ(HELLO)").options("shr"))
11-
compile.dd(new DDStatement().name("SYSUT1").options("cyl space(5,5) unit(vio) new"))
12-
compile.dd(new DDStatement().name("SYSUT2").options("cyl space(5,5) unit(vio) new"))
13-
compile.dd(new DDStatement().name("SYSUT3").options("cyl space(5,5) unit(vio) new"))
14-
compile.dd(new DDStatement().name("SYSUT4").options("cyl space(5,5) unit(vio) new"))
15-
compile.dd(new DDStatement().name("SYSUT5").options("cyl space(5,5) unit(vio) new"))
16-
compile.dd(new DDStatement().name("SYSUT6").options("cyl space(5,5) unit(vio) new"))
17-
compile.dd(new DDStatement().name("SYSUT7").options("cyl space(5,5) unit(vio) new"))
18-
compile.dd(new DDStatement().name("SYSUT8").options("cyl space(5,5) unit(vio) new"))
19-
compile.dd(new DDStatement().name("SYSUT9").options("cyl space(5,5) unit(vio) new"))
20-
compile.dd(new DDStatement().name("SYSUT10").options("cyl space(5,5) unit(vio) new"))
21-
compile.dd(new DDStatement().name("SYSUT11").options("cyl space(5,5) unit(vio) new"))
22-
compile.dd(new DDStatement().name("SYSUT12").options("cyl space(5,5) unit(vio) new"))
23-
compile.dd(new DDStatement().name("SYSUT13").options("cyl space(5,5) unit(vio) new"))
24-
compile.dd(new DDStatement().name("SYSUT14").options("cyl space(5,5) unit(vio) new"))
25-
compile.dd(new DDStatement().name("SYSUT15").options("cyl space(5,5) unit(vio) new"))
26-
compile.dd(new DDStatement().name("SYSUT16").options("cyl space(5,5) unit(vio) new"))
27-
compile.dd(new DDStatement().name("SYSUT17").options("cyl space(5,5) unit(vio) new"))
25+
compile.dd(new DDStatement().name("SYSIN").dsn("${hlq}.COBOL(HELLO)").options("shr"))
26+
compile.dd(new DDStatement().name("SYSLIN").dsn("${hlq}.OBJ(HELLO)").options("shr"))
27+
28+
(1..17).toList().each { num ->
29+
compile.dd(new DDStatement().name("SYSUT$num").options("cyl space(5,5) unit(vio) new"))
30+
}
31+
2832
compile.dd(new DDStatement().name("SYSMDECK").options("cyl space(5,5) unit(vio) new"))
29-
compile.dd(new DDStatement().name("TASKLIB").dsn("IGY.V6R1M0.SIGYCOMP").options("shr"))
33+
compile.dd(new DDStatement().name("TASKLIB").dsn("${compilerDS}").options("shr"))
3034
compile.dd(new DDStatement().name("SYSPRINT").options("cyl space(5,5) unit(vio) new"))
31-
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("/u/usr1/build/hello.log")))
35+
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("${sourceDir}/hello_cbl.log")))
3236
def rc = compile.execute()
3337

3438
if (rc > 4)

Build/HelloWorld/hello_pli.groovy

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
import com.ibm.dbb.build.*
22

3-
println("Copying /u/usr1/build/hello.pli to USR1.BUILD.PLI(HELLO) . . .")
4-
def copy = new CopyToPDS().file(new File("/u/usr1/build/hello.pli")).dataset("USR1.BUILD.PLI").member("HELLO")
3+
// Change the following variables to match your system
4+
hlq = "USER.BUILD"
5+
sourceDir = "/u/user/build"
6+
compilerDS = "IBMZ.V5R2M0.SIBMZCMP"
7+
8+
println("Creating ${hlq}.PLI. . .")
9+
CreatePDS createPDSCmd = new CreatePDS();
10+
createPDSCmd.setDataset("${hlq}.PLI");
11+
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
12+
createPDSCmd.create();
13+
14+
println("Creating ${hlq}.OBJ. . .")
15+
createPDSCmd.setDataset("${hlq}.OBJ");
16+
createPDSCmd.setOptions("tracks space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)");
17+
createPDSCmd.create();
18+
19+
println("Copying ${sourceDir}/hello.pli to ${hlq}.PLI(HELLO) . . .")
20+
def copy = new CopyToPDS().file(new File("${sourceDir}/hello.pli")).dataset("${hlq}.PLI").member("HELLO")
521
copy.execute()
622

7-
println("Compiling USR1.BUILD.PLI(HELLO). . .")
23+
println("Compiling ${hlq}.PLI(HELLO). . .")
824
def compile = new MVSExec().pgm("IBMZPLI").parm("SOURCE")
9-
compile.dd(new DDStatement().name("SYSIN").dsn("USR1.BUILD.PLI(HELLO)").options("shr"))
10-
compile.dd(new DDStatement().name("SYSLIN").dsn("USR1.BUILD.OBJ(HELLO)").options("shr"))
25+
compile.dd(new DDStatement().name("SYSIN").dsn("${hlq}.PLI(HELLO)").options("shr"))
26+
compile.dd(new DDStatement().name("SYSLIN").dsn("${hlq}.OBJ(HELLO)").options("shr"))
1127
compile.dd(new DDStatement().name("SYSUT1").options("cyl space(5,5) unit(vio) new"))
1228
compile.dd(new DDStatement().name("SYSTERM").options("cyl space(5,5) unit(vio) new"))
1329
compile.dd(new DDStatement().name("SYSPUNCH").options("cyl space(5,5) unit(vio) new"))
1430
compile.dd(new DDStatement().name("SYSOUT").options("cyl space(5,5) unit(vio) new"))
15-
compile.dd(new DDStatement().name("TASKLIB").dsn("IBMZ.V5R2M0.SIBMZCMP").options("shr"))
31+
compile.dd(new DDStatement().name("TASKLIB").dsn("${compilerDS}").options("shr"))
1632
compile.dd(new DDStatement().name("SYSPRINT").options("cyl space(5,5) unit(vio) new"))
17-
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("/u/usr1/build/hello_pli.log")))
33+
compile.copy(new CopyToHFS().ddName("SYSPRINT").file(new File("${sourceDir}/hello_pli.log")))
1834
def rc = compile.execute()
1935

2036
if (rc > 4)

Build/MortgageApplication/build/Tools.groovy

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def parseArgs(String[] cliArgs, String usage) {
3636
def loadProperties(OptionAccessor opts) {
3737
// check to see if there is a ./build.properties to load
3838
def properties = BuildProperties.getInstance()
39-
def buildPropFile = new File("${getScriptDir()}/build.yaml")
39+
// One may also use YAML files as an alternative to properties files (DBB 1.0.6 and later):
40+
// def buildPropFile = new File("${getScriptDir()}/build.yaml")
41+
def buildPropFile = new File("${getScriptDir()}/build.properties")
4042
if (buildPropFile.exists())
4143
BuildProperties.load(buildPropFile)
4244

@@ -79,7 +81,9 @@ def loadProperties(OptionAccessor opts) {
7981
// load datasets.properties containing system specific PDS names used by Mortgage Application build
8082
properties.load(new File("${getScriptDir()}/datasets.properties"))
8183
// load file.properties containing file specific properties like script mappings and CICS/DB2 content flags
82-
properties.load(new File("${getScriptDir()}/file.yaml"))
84+
// One may also use YAML files as an alternative to properties files (DBB 1.0.6 and later):
85+
// properties.load(new File("${getScriptDir()}/file.yaml"))
86+
properties.load(new File("${getScriptDir()}/file.properties"))
8387
// load bind.properties containing DB2 BIND PACKAGE parameters used by Mortgage Application build
8488
properties.load(new File("${getScriptDir()}/bind.properties"))
8589
// load bindlinkEditScanner.properties containing Link Edit scanning options used by Mortgage Application build

Build/zAppBuild/BUILD.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ build options:
6464
-r,--reset Deletes the application's dependency collections
6565
and build result group from the DBB repository
6666
-v,--verbose Flag to turn on script trace
67+
-d,--debug Flag to build modules for debugging with
68+
IBM Debug for z/OS
6769
-l,--logEncoding <arg> Encoding of output logs. Default is EBCDIC
6870
6971
web application credentials

Build/zAppBuild/application/application-conf/Assembler.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ assembler_fileBuildRank=
1010
# can be overridden by file properties
1111
assembler_pgmParms=LIST
1212
assembler_linkEditParms=MAP,RENT,COMPAT(PM5)
13+
assembler_compileErrorPrefixParms=ADATA,EX(ADX(ELAXHASM))
1314

1415
#
1516
# execute link edit step

Build/zAppBuild/application/application-conf/Cobol.properties

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,25 @@ cobol_compileCICSParms=CICS
2929
cobol_compileSQLParms=SQL
3030
cobol_compileErrorPrefixParms=ADATA,EX(ADX(ELAXMGUX))
3131

32+
# Compile Options for IBM Debugger. Assuming to keep Dwarf Files inside the load.
33+
# If you would like to separate debug info, additional allocations needed (See COBOL + Debugger libraries)
34+
cobol_compileDebugParms=TEST
35+
3236
#
3337
# default LinkEdit parameters
3438
# can be overridden by file properties
3539
cobol_linkEditParms=MAP,RENT,COMPAT(PM5)
3640

41+
# If you would like to have a physical link card, we generated it for you given the below pattern
42+
# This property has priority over cobol_linkDebugExit
43+
# cobol_linkEditStream= INCLUDE OBJECT(@{member})
44+
cobol_linkEditStream=
45+
46+
# If using a debug exit, provide the SYSLIN instream DD
47+
# Samp: cobol_linkDebugExit= INCLUDE OBJECT(@{member}) \n INCLUDE SYSLIB(EQAD3CXT)
48+
cobol_linkDebugExit= INCLUDE OBJECT(@{member}) \n INCLUDE SYSLIB(EQAD3CXT)
49+
50+
3751
#
3852
# execute link edit step
3953
# can be overridden by file properties

Build/zAppBuild/application/application-conf/PLI.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pli_linkEditMaxRC=0
2727
pli_compileParms=PP(INCLUDE('ID(++INCLUDE)'))
2828
pli_compileCICSParms=SYSTEM(CICS),PP(MACRO,CICS)
2929
pli_compileSQLParms=PP(SQL)
30-
pli_compileErrorPrefixParms=ADATA,EX(ADX(ELAXMGUX))
30+
pli_compileErrorPrefixParms=XINFO(XML)
3131

3232
#
3333
# default LinkEdit parameters

Build/zAppBuild/application/application-conf/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Comma separated list of additional application property files to load
55
# Supports both relative path (to ${application}/application-conf/) and absolute path
6-
applicationPropFiles=file.properties,bind.properties,Assembler.properties,BMS.properties,Cobol.properties,LinkEdit.properties,PLI.properties
6+
applicationPropFiles=file.properties,bind.properties,Assembler.properties,BMS.properties,Cobol.properties,LinkEdit.properties,bind.properties,PLI.properties
77

88
#
99
# Comma separated list all source directories included in application build. Supports both absolute

Build/zAppBuild/application/application-conf/bind.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111
bind_maxRC=4
1212

1313
# Flag indicating to run DB2 BIND PACKAGE. Set to 'true' to bind SQL programs
14-
RUN_DB2_BIND = false
14+
bind_performBindPackage=false
1515

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

2020
# Specify the name of the DB2 subsystem
21-
SUBSYS =
21+
bind_db2Location=
2222

2323
# Specify the DB2 collection (Package)
24-
COLLID =
24+
bind_collectionID=
2525

26-
# Specify the owner of the package
27-
OWNER =
26+
# Specify the owner of the package, if empty user.name will be used
27+
bind_packageOwner=
2828

2929
# Specify the value of the implicit qualifier.
30-
QUAL =
30+
bind_qualifier=

0 commit comments

Comments
 (0)