diff --git a/Build/HelloWorld/.project b/Build/HelloWorld/.project deleted file mode 100644 index ed134aac..00000000 --- a/Build/HelloWorld/.project +++ /dev/null @@ -1,13 +0,0 @@ - - - HelloWorld - - - - - - - com.ibm.ftt.ui.views.project.navigator.local - com.ibm.ftt.dbbz.integration.dbbzprojectnature - - diff --git a/Build/HelloWorld/README.md b/Build/HelloWorld/README.md deleted file mode 100644 index fd01f7b0..00000000 --- a/Build/HelloWorld/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# HelloWorld Sample -The HelloWorld sample provides simple COBOL and PL/I programs and the Groovy build scripts to compile them to show the simplest form of using DBB to build z/OS programs. In order to keep the build scripts as simple as possible, hard coded values are used and need to be changed in order for the script to run on your system. - - - - diff --git a/Build/HelloWorld/hello.asm b/Build/HelloWorld/hello.asm deleted file mode 100644 index 8e672bc1..00000000 --- a/Build/HelloWorld/hello.asm +++ /dev/null @@ -1,9 +0,0 @@ -HELLO CSECT - USING *,15 - STM 14,12,12(13) - LR 12,15 - USING HELLO,12 - WTO 'HI' - XR 15,15 - RETURN (14,12) - END diff --git a/Build/HelloWorld/hello.cbl b/Build/HelloWorld/hello.cbl deleted file mode 100644 index a2542e4b..00000000 --- a/Build/HelloWorld/hello.cbl +++ /dev/null @@ -1,7 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. HELLO. - - PROCEDURE DIVISION. - DISPLAY "Hello world!". - STOP RUN. - diff --git a/Build/HelloWorld/hello.pli b/Build/HelloWorld/hello.pli deleted file mode 100644 index 2771b0b0..00000000 --- a/Build/HelloWorld/hello.pli +++ /dev/null @@ -1,3 +0,0 @@ - Hello2: proc options(main); - put list ('Hello world!'); - end Hello2; \ No newline at end of file diff --git a/Build/HelloWorld/hello_asm.groovy b/Build/HelloWorld/hello_asm.groovy deleted file mode 100644 index d44b3699..00000000 --- a/Build/HelloWorld/hello_asm.groovy +++ /dev/null @@ -1,49 +0,0 @@ -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 ${hlq}.HASRC") -new CopyToPDS().file(new File("${sourceDir}/hello.asm")).dataset("${hlq}.HASRC").member("HELLO").execute() - -// assemble the build file -println("Assembling hello.asm") - -// define the MVSExec command to compile the file -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("${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("${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("${sourceDir}/hello_asm.log"))) - -// execute the MVSExec compile command -def rc = compile.execute() - -if (rc > 4) - println("Assembly failed! RC=$rc") -else - println("Assembly successful! RC=$rc") diff --git a/Build/HelloWorld/hello_cbl.groovy b/Build/HelloWorld/hello_cbl.groovy deleted file mode 100644 index a885d2d1..00000000 --- a/Build/HelloWorld/hello_cbl.groovy +++ /dev/null @@ -1,42 +0,0 @@ -import com.ibm.dbb.build.* - -// 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 ${hlq}.COBOL(HELLO). . .") -def compile = new MVSExec().pgm("IGYCRCTL").parm("LIB") -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("${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("${sourceDir}/hello_cbl.log"))) -def rc = compile.execute() - -if (rc > 4) - println("Compile failed! RC=$rc") -else - println("Compile successful! RC=$rc") - diff --git a/Build/HelloWorld/hello_pli.groovy b/Build/HelloWorld/hello_pli.groovy deleted file mode 100644 index aec35a15..00000000 --- a/Build/HelloWorld/hello_pli.groovy +++ /dev/null @@ -1,39 +0,0 @@ -import com.ibm.dbb.build.* - -// 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 ${hlq}.PLI(HELLO). . .") -def compile = new MVSExec().pgm("IBMZPLI").parm("SOURCE") -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("${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("${sourceDir}/hello_pli.log"))) -def rc = compile.execute() - -if (rc > 4) - println("Compile failed! RC=$rc") -else - println("Compile successful! RC=$rc") diff --git a/Build/MultiThreadMVSJob/.project b/Build/MultiThreadMVSJob/.project deleted file mode 100644 index 38ffba77..00000000 --- a/Build/MultiThreadMVSJob/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - MultiThreadMVSJob - - - - - - - - diff --git a/Build/MultiThreadMVSJob/COBOL/Test1.cbl b/Build/MultiThreadMVSJob/COBOL/Test1.cbl deleted file mode 100644 index 55cfe4da..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test1.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST1. - - PROCEDURE DIVISION. - DISPLAY "One". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/COBOL/Test10.cbl b/Build/MultiThreadMVSJob/COBOL/Test10.cbl deleted file mode 100644 index 58a4756d..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test10.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST10. - - PROCEDURE DIVISION. - DISPLAY "Ten". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/COBOL/Test2.cbl b/Build/MultiThreadMVSJob/COBOL/Test2.cbl deleted file mode 100644 index 3d0a36f8..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test2.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST2. - - PROCEDURE DIVISION. - DISPLAY "Two". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/COBOL/Test3.cbl b/Build/MultiThreadMVSJob/COBOL/Test3.cbl deleted file mode 100644 index 166f85ec..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test3.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST3. - - PROCEDURE DIVISION. - DISPLAY "Three". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/COBOL/Test4.cbl b/Build/MultiThreadMVSJob/COBOL/Test4.cbl deleted file mode 100644 index 2b6f9d77..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test4.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST4. - - PROCEDURE DIVISION. - DISPLAY "Four". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/COBOL/Test5.cbl b/Build/MultiThreadMVSJob/COBOL/Test5.cbl deleted file mode 100644 index 8f02ad7b..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test5.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST5. - - PROCEDURE DIVISION. - DISPLAY "Five". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/COBOL/Test6.cbl b/Build/MultiThreadMVSJob/COBOL/Test6.cbl deleted file mode 100644 index 777c8d97..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test6.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST6. - - PROCEDURE DIVISION. - DISPLAY "Six". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/COBOL/Test7.cbl b/Build/MultiThreadMVSJob/COBOL/Test7.cbl deleted file mode 100644 index fdedc301..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test7.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST7. - - PROCEDURE DIVISION. - DISPLAY "Seven". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/COBOL/Test8.cbl b/Build/MultiThreadMVSJob/COBOL/Test8.cbl deleted file mode 100644 index 91a84726..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test8.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST8. - - PROCEDURE DIVISION. - DISPLAY "Eight". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/COBOL/Test9.cbl b/Build/MultiThreadMVSJob/COBOL/Test9.cbl deleted file mode 100644 index 9b6644b5..00000000 --- a/Build/MultiThreadMVSJob/COBOL/Test9.cbl +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFICATION DIVISION. - PROGRAM-ID. TEST9. - - PROCEDURE DIVISION. - DISPLAY "Nine". - STOP RUN. \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/Compile.groovy b/Build/MultiThreadMVSJob/Compile.groovy deleted file mode 100644 index 22d905a0..00000000 --- a/Build/MultiThreadMVSJob/Compile.groovy +++ /dev/null @@ -1,100 +0,0 @@ -import com.ibm.dbb.build.* -import java.util.concurrent.* -import java.util.concurrent.atomic.* - -//******************************************************************************** -// This simple script is used to compile and linkedit sample Cobol files. It -// processes file in sequence non-thread environment. The purpose of having -// this script in the sample so that we can illustrate how to convert it -// to support multi-thread environment. -// =============================================================================== -// Required Modification: -// 1. Need to change the HLQ variable for the source and output of the PDS. -//******************************************************************************** - -ElapsedTimer timer = new ElapsedTimer() -timer.start() - -//***************************************** -// Define datasets for source and output -//***************************************** -// Sample: 'USER.DBB.TEST' -def HLQ = -def compilerDS = "IGY.V6R1M0.SIGYCOMP" -def sourcePDS = "${HLQ}.COBOL" -def objPDS = "${HLQ}.OBJ" -def loadPDS = "${HLQ}.LOAD" - -//******************************************************************************** -//* Locate the current directory where build script and source files are on zFS -//******************************************************************************** -def currentDir = new File(getClass().protectionDomain.codeSource.location.path).parentFile -def cobolDir = new File(currentDir, 'COBOL') -def logDir = new File(currentDir, 'logs') - -//******************************************************************************** -//Create required PDS -//******************************************************************************** -new CreatePDS().dataset(sourcePDS).options('cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)').create() -new CreatePDS().dataset(objPDS).options('cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)').create() -new CreatePDS().dataset(loadPDS).options('cyl space(1,1) dsorg(PO) recfm(U) blksize(32760) dsntype(library) msg(1)').create() - -//******************************************************************************** - // Setup a process counter to count the number of files processed. - //******************************************************************************** -def processCounter = 0 - -//******************************************************************************** -// Fetch all source files from zFS to PDS -//******************************************************************************** -cobolDir.eachFile { file -> - - def member = file.name.take(file.name.lastIndexOf('.')) - println "Copy '$file' to $sourcePDS($member)" - new CopyToPDS().file(file).dataset(sourcePDS).member(member).execute() - - def logFile = new File(logDir, "${member}.log") - - //Setup a MVSExec compile step - def compileStep = new MVSExec().file("$file").pgm('IGYCRCTL').parm('LIB') - compileStep.dd(new DDStatement().name("SYSIN").dsn("$sourcePDS($member)").options("shr").report(true)) - compileStep.dd(new DDStatement().name("SYSLIN").dsn("$objPDS($member)").options("shr").output(true).pass(true)) - compileStep.dd(new DDStatement().name("SYSUT1").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT2").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT3").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT4").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT5").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT6").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT7").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSMDECK").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("TASKLIB").dsn(compilerDS).options("shr")) - compileStep.dd(new DDStatement().name("SYSPRINT").options('cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new')) - compileStep.copy(new CopyToHFS().ddName("SYSPRINT").file(logFile)) - - //Setup a MVSExec linkedit step - def linkeditStep = new MVSExec().file("$file").pgm("IEWBLINK").parm("MAP,RENT,COMPAT(PM5)") - linkeditStep.dd(new DDStatement().name("SYSLMOD").dsn("$loadPDS($member)").options("shr").output(true).deployType("LOAD")) - linkeditStep.dd(new DDStatement().name("SYSPRINT").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - linkeditStep.dd(new DDStatement().name("SYSUT1").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - linkeditStep.dd(new DDStatement().name("SYSLIB").dsn(objPDS).options("shr")) - linkeditStep.dd(new DDStatement().dsn('CEE.SCEELKED').options("shr")) - linkeditStep.copy(new CopyToHFS().ddName("SYSPRINT").file(logFile).append(true)) - - //Run the above MVSExecs in a MVSJob - def job = new MVSJob() - job.start() - - def rc = compileStep.execute() - if (rc <= 4) - rc = linkeditStep.execute() - - println "Result of processing $member: $rc" - - job.stop() - - processCounter++ -} - -println "Build complete in ${timer.stop()}" -println "Total files processed: $processCounter" - diff --git a/Build/MultiThreadMVSJob/CompileUseThread.groovy b/Build/MultiThreadMVSJob/CompileUseThread.groovy deleted file mode 100644 index a9be5777..00000000 --- a/Build/MultiThreadMVSJob/CompileUseThread.groovy +++ /dev/null @@ -1,178 +0,0 @@ -import com.ibm.dbb.build.* -import java.util.concurrent.* -import java.util.concurrent.atomic.* - -//******************************************************************************** -// This is the multi-thread version of the Compile.groovy. The following changes -// to the Compile.groovy are needed: -// -// 1. Separate the fetch and compile steps. Perform fetch for all files in -// the main thread. Perform the compile steps using a thread pool. -// 2. Setup a thread pool with maximum number of threads allowed. -// 3. Setup a completion service for the thread pool so that we can wait for -// the completion of each thread. -// 4. The processCounter is changed from Integer to AtomicInteger to support -// multi-thread to update the counter. -// 5. Include the MVSJob in the thread submit closure. -// 6. Invoke ThreadPool.shutdown after all threads are complete. -// =============================================================================== -// Required Modification: -// 1. Need to change the HLQ variable for the source and output of the PDS. -//******************************************************************************** - -ElapsedTimer timer = new ElapsedTimer() -timer.start() - -//***************************************** -// Define datasets for source and output -//***************************************** -// Sample: 'USER.DBB.TEST' -def HLQ = -def compilerDS = "IGY.V6R1M0.SIGYCOMP" -def sourcePDS = "${HLQ}.COBOL" -def objPDS = "${HLQ}.OBJ" -def loadPDS = "${HLQ}.LOAD" - -//******************************************************************************** -//* Locate the current directory where build script and source files are on zFS -//******************************************************************************** -def currentDir = new File(getClass().protectionDomain.codeSource.location.path).parentFile -def cobolDir = new File(currentDir, 'COBOL') -def logDir = new File(currentDir, 'logs') - -//******************************************************************************** -//Create required PDS -//******************************************************************************** -new CreatePDS().dataset(sourcePDS).options('cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)').create() -new CreatePDS().dataset(objPDS).options('cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)').create() -new CreatePDS().dataset(loadPDS).options('cyl space(1,1) dsorg(PO) recfm(U) blksize(32760) dsntype(library) msg(1)').create() - -//******************************************************************************** -// Create a thread pool of 2 (maximum of 2 threads will run at once). -//******************************************************************************** -int maxPoolSize = 2 -ExecutorService threadPool = Executors.newFixedThreadPool(maxPoolSize) - -//******************************************************************************** -// Setup a CompletionService so that we can track the completion of the thread. -// The purpose of this is to ensure that we count the number of files processed -// correctly, and also to ensure that any post-processing is performed only -// after all threads have finished, ie: shutting down the thread pool. -//******************************************************************************** -ExecutorCompletionService completionService = new ExecutorCompletionService(threadPool) - -//******************************************************************************** -// Setup a process counter to count the number of files processed. -//******************************************************************************** -def processCounter = new AtomicInteger() - -//******************************************************************************** -// Total number of files to be processed. -//******************************************************************************** -def totalCounter = 0 - -//******************************************************************************** -// Fetch all source files from zFS to PDS -//******************************************************************************** -println 'Start fetch...' -cobolDir.eachFile { file -> - - def member = file.name.take(file.name.lastIndexOf('.')) - println "Copy '$file' to $sourcePDS($member)" - new CopyToPDS().file(file).dataset(sourcePDS).member(member).execute() - totalCounter++ - -} -println "Complete fetch in ${timer.pause()}" - -//******************************************************************************** -// For each file, setup a MVSJob to include compile and linkedit steps and -// execute each MVSJob in a thread when there is available thread in the pool. -//******************************************************************************** -println 'Start compile...' -cobolDir.eachFile { file -> - - def member = file.name.take(file.name.lastIndexOf('.')) - def logFile = new File(logDir, "${member}.log") - - //Setup a MVSExec compile step - def compileStep = new MVSExec().file("$file").pgm('IGYCRCTL').parm('LIB') - compileStep.dd(new DDStatement().name("SYSIN").dsn("$sourcePDS($member)").options("shr").report(true)) - compileStep.dd(new DDStatement().name("SYSLIN").dsn("$objPDS($member)").options("shr").output(true).pass(true)) - compileStep.dd(new DDStatement().name("SYSUT1").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT2").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT3").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT4").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT5").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT6").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSUT7").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("SYSMDECK").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - compileStep.dd(new DDStatement().name("TASKLIB").dsn(compilerDS).options("shr")) - compileStep.dd(new DDStatement().name("SYSPRINT").options('cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new')) - compileStep.copy(new CopyToHFS().ddName("SYSPRINT").file(logFile)) - - //Setup a MVSExec linkedit step - def linkeditStep = new MVSExec().file("$file").pgm("IEWBLINK").parm("MAP,RENT,COMPAT(PM5)") - linkeditStep.dd(new DDStatement().name("SYSLMOD").dsn("$loadPDS($member)").options("shr").output(true).deployType("LOAD")) - linkeditStep.dd(new DDStatement().name("SYSPRINT").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - linkeditStep.dd(new DDStatement().name("SYSUT1").options("cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new")) - linkeditStep.dd(new DDStatement().name("SYSLIB").dsn(objPDS).options("shr")) - linkeditStep.dd(new DDStatement().dsn('CEE.SCEELKED').options("shr")) - linkeditStep.copy(new CopyToHFS().ddName("SYSPRINT").file(logFile).append(true)) - - //Submit the MVSJob that includes the above 2 MVSExecs to run in a thread - completionService.submit { - - def job = new MVSJob() - try - { - job.start() - - def rc = compileStep.execute() - if (rc <= 4) - rc = linkeditStep.execute() - - println "Result of processing $member: $rc" - } - catch (Exception e) - { - e.printStackTrace() - return false - } - finally - { - job.stop() - } - return true - } -} - -//******************************************************************************** -// Block and wait for all threads to complete. Notice that threads can finish -// not in the same order as they are started. As each thread completed, -// increment the counter. -//******************************************************************************** -boolean success = true -for (int i=0; i status = completionService.take() - boolean rc = status.get() - if (!rc) - success = rc - processCounter.incrementAndGet() -} - -println "Complete compile in ${timer.pause()}" -println "Total files processed: $processCounter" -if (success) - println "Build Completed SUCCESSFULLY" -else - println "Build Completed with ERROR" - -//******************************************************************************** -// This is required to clean up all resources allocated for each thread in -// the pool. -//******************************************************************************** -threadPool.shutdown() - -println "Build completed in ${timer.stop()}" diff --git a/Build/MultiThreadMVSJob/ElapsedTimer.groovy b/Build/MultiThreadMVSJob/ElapsedTimer.groovy deleted file mode 100644 index aa07d29c..00000000 --- a/Build/MultiThreadMVSJob/ElapsedTimer.groovy +++ /dev/null @@ -1,23 +0,0 @@ -import groovy.time.* - -def now = new Date() -def now2 = new Date() - -def start() -{ - now = now2 = new Date() -} - -def TimeDuration pause() -{ - def duration = TimeCategory.minus(new Date(), now2) - now2 = new Date() - return duration -} - -def TimeDuration stop() -{ - def duration = TimeCategory.minus(new Date(), now) - now = new Date() - return duration -} \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/README.md b/Build/MultiThreadMVSJob/README.md deleted file mode 100644 index d2c05510..00000000 --- a/Build/MultiThreadMVSJob/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Run MVSJob in Multi-Thread Environment -The following sample shows how to modify a simple Compile.groovy to support multi-thread environment. - -## Files -1. COBOL/*.cbl - Sample cobol files that are used by the compile groovy scripts. -2. Compile.groovy - Simple compile script that processes file in sequential. This script is used for comparison as well as a way to illustrate the steps required to convert to run MVSJob in multi-thread environment. -3. CompileUseThread.groovy - The version of compile groovy script that runs MVSJob in multi-thread environment. -4. *.sh - Shell scripts for convenienly running the compile scripts. -5. ElapsedTimer.groovy - A utility class to calculate time spent in each build to illustrate the benefit of running MVSJob in multi-thread environment. diff --git a/Build/MultiThreadMVSJob/compile.sh b/Build/MultiThreadMVSJob/compile.sh deleted file mode 100644 index a55c928a..00000000 --- a/Build/MultiThreadMVSJob/compile.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Set the DBB bin directory -DBB_HOME= -export DBB_HOME - -# $DBB_HOME/bin/groovyz automatically sets the env variables and classpath required for DBB -CMD="$DBB_HOME/bin/groovyz Compile.groovy" - -$CMD \ No newline at end of file diff --git a/Build/MultiThreadMVSJob/compileUseThread.sh b/Build/MultiThreadMVSJob/compileUseThread.sh deleted file mode 100644 index c33f1b9e..00000000 --- a/Build/MultiThreadMVSJob/compileUseThread.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Set the DBB bin directory -DBB_HOME= -export DBB_HOME - -# $DBB_HOME/bin/groovyz automatically sets the env variables and classpath required for DBB -CMD="$DBB_HOME/bin/groovyz -DDBB_SUBPROCESS_ENABLED=true CompileUseThread.groovy" - -$CMD \ No newline at end of file diff --git a/Build/README.md b/Build/README.md deleted file mode 100644 index 82d1a8b2..00000000 --- a/Build/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Build -This category contains examples of using DBB to modernize the way traditional z/OS applications are built and deployed as part of a CI pipeline. diff --git a/Migration/README.md b/Migration/README.md index 9b4b6959..e718fe71 100644 --- a/Migration/README.md +++ b/Migration/README.md @@ -1,3 +1,5 @@ -# Migration -This category contains examples of using the [DBB Migration Tool](https://www.ibm.com/support/knowledgecenter/SS6T76_1.0.3/migration.html) -to migrate z/OS souce code to Git. +# Contents + +| Sample | Description | +| --- | --- | +| [jclToZBuilder](jclToZBuilder/) | Utilities to migrate build JCLs into zBuilder language YAML configuration. | diff --git a/Migration/jcl/README.md b/Migration/jcl/README.md deleted file mode 100644 index faf8cf96..00000000 --- a/Migration/jcl/README.md +++ /dev/null @@ -1,55 +0,0 @@ - -# JCL Migration Sample -### Overview -This sample provides a script to migrate JCL from a Z/OS dataset to a Groovy script. The sample is a combination of Unix shell scripts, Apache Groovy scripts, templates, and configuration files. - -### Prerequisites -* DBB Toolkit - * DBB_HOME environment variable must be set -* Rocket’s Git and supporting open source tools -* IBM Java v8 64bit - * JAVA_HOME environment variable must be set - -### Folder Content -* bin - Contains the shell script that drives the migration process -* conf - Contains the jclmig.config file that contains optional parameters used by the migration process -* groovy - Contains Groovy/DBB scripts that are invoked by the shell scripts -* template - Contains template for the generated Groovy scripts - -### Configuration -Fill in information related to the JCL project in conf/jclmig.config file. The conf/jclmig.config file contains the configuration for the migration process. You can copy, modify, and rename configuration files for different JCL projects but you should use the same configuration file for both steps of the migration process. - -**Optional Configuration** -* restrictedPgms: A comma separated list of programs that require APF authorization or other special treatment. These are usually programs like IFJEFT01 which starts a TSO environment. Because these programs cannot be called directly from a Groovy environment, the migration tool will attempt to convert these steps into inline JCL. Warnings will be produced and the generated code should be reviewed before running the generated scripts. Add additional programs as necessary. By default, the list contains IKJEFT01, IKJEFT1A, IKJEFT1B, IRXJCL, and IOEAGFMT. -* tempDataSetOptions: Default BPXWDYN options used to allocate temporary datasets when no other options are specified on the DD Statement. If you have coded SYSOUT=* or DUMMY as your DD statement these options will be used. The default value is 'cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new'. -* procLibs: A comma separated list of PROCLIBs to scan when the JCL being migrated contains EXEC procName statements. - -## Migration Process -The JCL migration is a single step process that includes scanning the JCL to produce DBB XML and then converting the XML into a Groovy script using DBB functionality to accomplish the same tasks. The migration is performed by invoking JCLtoDBB.sh in the bin directory. - -``` -./JCLtoDBB.sh -d USER.PROJECT.JCL -m MEMBER -p PROJECT -o jclMigration -c ../conf/jclmig.config -s false -g false - -usage: JCLtoDBB.groovy [options] - -c,--configFile Path to the JCL migration configuration file. If specified, path is considered absolute if it - begins with a slash else it is relative path from the migration tool bin directory. Default is - ../conf/jclmig.config. - -d,--dataset Dataset containing JCL to be migrated - -g,--genExecVars Specify true to generate executable variables - -h,--help Show usage information - -m,--member JCL member being migrated - -o,--outputDir Directory in zFS where all files will be written. If specified, path is considered absolute if - it begins with a slash else it is relative path from the users home directory. Default is - jclMigration. - -p,--project JCL project to be migrated - -s,--saveOutputs Specify true to generated code to save outputs from a JCLExec -``` - -### JCL Migration to DBB XML -This portion of the process will scan the JCL and produce a DBB XML file that represents the steps, programs, and datasets, used in the JCL. - - -### Groovy Script Generation -The Groovy script generation portion of the process takes the DBB XML file created and generates a shell script and a Groovy script. The generated Groovy script calls DBB functionality to perform the steps done in the original JCL. The shell script is a convenience script to start the Groovy script. - - diff --git a/Migration/jcl/bin/JCLtoDBB.sh b/Migration/jcl/bin/JCLtoDBB.sh deleted file mode 100755 index 8a3671c0..00000000 --- a/Migration/jcl/bin/JCLtoDBB.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -############################################################################################## -# -# This script calls the JCLtoDBB.groovy script to parse the JCL and generate DBB groovy -# scripts representing the JCL. -# -############################################################################################## -scriptDir=$(dirname $0) -if [[ -z "${DBB_HOME}" ]]; then - echo "Need to specified the required environment variable 'DBB_HOME'" - exit 8 -fi -NLSPATH=$DBB_HOME/lib/dmhmsg.cat:$NLSPATH - -CMD="$DBB_HOME/bin/groovyz $scriptDir/../groovy/JCLtoDBB.groovy $@" - -$CMD -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi diff --git a/Migration/jcl/conf/jclmig.config b/Migration/jcl/conf/jclmig.config deleted file mode 100644 index 5f41867f..00000000 --- a/Migration/jcl/conf/jclmig.config +++ /dev/null @@ -1,35 +0,0 @@ -###################################################################### -# This config file contains optional settings for the JCL # -# migration. Required settings are passed via the command line: # -# # -# restrictedPgms : A comma separated list of programs that require# -# APF authorization to run. These are usually # -# programs like IFJEFT01 which are used to run # -# REXX scripts. The migration tool will attempt # -# to convert the calls to these programs into # -# calls to the underlying command or REXX script.# -# Warnings will be produced and the generated # -# code should be reviewed and adjustments made # -# before running the generated scripts. Add # -# additional programs as necessary. # -# By default, the list contains IKJEFT01, # -# IKJEFT1A, IKJEFT1B, IRXJCL, and IOEAGFMT. # -# # -# tempDataSetOptions: Default BPXWDYN options used to allocate # -# temporary datasets when no other options are # -# specified on the DD Statement. If you have # -# coded SYSOUT=* or DUMMY as your DD statement # -# these options will be used. The default value # -# is # -# cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new # -# # -# procLibs : A comma separated list of libraries that # -# will be scanned to locate JCL PROCs. # -# # -###################################################################### - -#restrictedPgms = PROG1,PROG2 - -#tempDataSetOptions = - -#procLibs = USER.PROCLIB,SYS1.PROCLIB diff --git a/Migration/jcl/groovy/DBBScriptTemplateConverter.groovy b/Migration/jcl/groovy/DBBScriptTemplateConverter.groovy deleted file mode 100644 index 1721b7b1..00000000 --- a/Migration/jcl/groovy/DBBScriptTemplateConverter.groovy +++ /dev/null @@ -1,297 +0,0 @@ -/* - * This script cannot be called as a standalone script since it requires - * additional binding variable passed in from the parent script. - * - * This script is used in conjunction with the SCRIPT.template to generate - * the DBB script.groovy script. - * - * @see GenerateBuildScrips.groovy. - */ -import groovy.transform.Field -import com.ibm.dbb.build.* - -/* - * This scriptXml represents the