|
1 | 1 | import com.ibm.dbb.build.* |
2 | 2 |
|
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") |
5 | 21 | copy.execute() |
6 | 22 |
|
7 | | -println("Compiling USR1.BUILD.COBOL(HELLO). . .") |
| 23 | +println("Compiling ${hlq}.COBOL(HELLO). . .") |
8 | 24 | 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 | + |
28 | 32 | 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")) |
30 | 34 | 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"))) |
32 | 36 | def rc = compile.execute() |
33 | 37 |
|
34 | 38 | if (rc > 4) |
|
0 commit comments