Language task: Cobol.yaml
Description
This sample provides the language task configuration to compile COBOL programs for the MortgageApplication sample. It is imported via Languages.yaml.
Actions
- Define sources.
- Define variables.
- Create datasets.
- Loop through steps for each build file.
- Copy build file and dependencies to datasets.
- Compile build file.
- Link-edit build file.
Define sources
Define sources
as a list of file patterns to locate COBOL programs within the build list.
sources:
- "**/cobol/*.cbl"
Task variables
Required variables
compileParms
Type: String
Default: ""
compileParms
is a conditional variable used to build compile parameters, e.g. CICS,SQL
, based on the properties of the build file.
- name: compileParms
append:
- condition: ${IS_CICS}
value: CICS
- condition: ${IS_SQL}
value: SQL
- condition:
exists: errPrefix
value: ADATA,EX(ADX(ELAXMGUX))
- condition:
exists: debug
eval: ${debug}
value: TEST
doLinkEdit
Type: boolean
Default: true
Flag to control if link-edit should be performed.
linkEditParms
Type: String
Default: MAP,RENT,COMPAT(PM5)
Link-edit parameters.
dependencySearchPath
Type: String
Default: search:\${WORKSPACE}/?path=\${APP_DIR_NAME}/copybook/*.cpy
Default dependency search path for a single repository build.
scanLoadModule
Type: boolean
Default: true
Flag indicating to scan the load module for static link dependencies.
Optional variables
subsystemSearchPath
Type: String
Default: ${dependencySearchPath}
When declared, used to resolve logical files using resolveSubsystems.
Create datasets
Create datasets which must exist and be validated prior to compile.
datasets:
- name: ${HLQ}.COBOL
options: cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)
- name: ${HLQ}.COPY
options: cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)
- name: ${HLQ}.BMS.COPY
options: cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)
- name: ${HLQ}.DBRM
options: cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)
- name: ${HLQ}.OBJ
options: cyl space(1,1) lrecl(80) dsorg(PO) recfm(F,B) dsntype(library)
- name: ${HLQ}.LOAD
options: cyl space(1,1) dsorg(PO) recfm(U) blksize(32760) dsntype(library)
Task steps
For each build file, the following steps will be executed.
Copy step
The copy step copySrc
copies the current build file from its HFS source to the dataset //'${HLQ}.COBOL(${MEMBER})'
along with any dependencies.
- step: copySrc
type: copy
source: ${WORKSPACE}/${FILE}
target: //'${HLQ}.COBOL(${MEMBER})'
dependencyCopy:
- search: ${dependencySearchPath}
mappings:
- source: "**/*"
dataset: ${HLQ}.COPY
Compile step
The mvs step compile
executes the IGYCRCTL compiler with the previously determined compileParms
and defines necessary DD statements.
- step: compile
type: mvs
pgm: IGYCRCTL
parm: ${compileParms}
maxRC: 8
dds:
- { name: "SYSIN", dsn: "${HLQ}.COBOL(${MEMBER})", options: "shr", input: true }
- { name: "SYSLIN", dsn: "${HLQ}.OBJ(${MEMBER})", options: "shr", output: true }
- { name: "TASKLIB", dsn: "${SIGYCOMP}", options: "shr" }
- { dsn: "${SDFHLOAD}", condition: "${IS_CICS}", options: "shr" }
- { dsn: "${SDSNLOAD}", condition: "${IS_SQL}", options: "shr" }
- { dsn: "${SFELLOAD}", condition: { exists: "SFELLOAD" }, options: "shr" }
- { name: "SYSPRINT", log: "${LOGS}/${STEP}-${FILE_NAME}.cbl.log", options: "cyl space(5,5) unit(vio) blksize(133) lrecl(133) recfm(f,b) new" }
- { name: "SYSMDECK", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT1", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT2", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT3", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT4", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT5", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT6", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT7", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT8", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new"}
- { name: "SYSUT9", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT10", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT11", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT12", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT13", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT14", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT15", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT16", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSUT17", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "SYSLIB", dsn: "${HLQ}.COPY", options: "shr" }
- { dsn: "${HLQ}.BMS.COPY", options: "shr" }
- { dsn: "${SDFHCOB}", condition: "${IS_CICS}", options: "shr" }
- { dsn: "${SCSQCOBC}", condition: "${IS_MQ}", options: "shr" }
- { name: "DBRMLIB", dsn: "${HLQ}.DBRM(${MEMBER})", condition: "${IS_SQL}", options: "shr", output: true, deployType: "DBRM" }
- { name: "SYSADATA", condition: { exists: "errPrefix" }, options: "DUMMY" }
- { name: "SYSXMLSD", condition: { exists: "errPrefix" }, dsn: "${HLQ}.${errPrefix}.SYSXMLSD.XML", options: "tracks space(200,40) dsorg(PS) blksize(27998) lrecl(16383) recfm(v,b) new keep" }
Link-edit
The mvs step linkEdit
optionally executes when variable doLinkEdit
is true
.
- step: linkEdit
type: mvs
pgm: IEWBLINK
parm: ${linkEditParms}
condition: ${doLinkEdit}
maxRC: 0
dds:
- { name: "SYSLIN", dsn: "${HLQ}.OBJ(${MEMBER})", options: "shr" }
- { name: "SYSLMOD", dsn: "${HLQ}.LOAD(${MEMBER})", options: "shr", output: true, deployType: "LOAD", scan: "${scanLoadModule}" }
- { name: "SYSPRINT", log: "${LOGS}/${STEP}-${FILE_NAME}.cbl.log", options: "cyl space(5,5) unit(vio) blksize(133) lrecl(133) recfm(f,b) new" }
- { name: "SYSUT1", options: "cyl space(5,5) unit(vio) blksize(80) lrecl(80) recfm(f,b) new" }
- { name: "RESLIB", condition: { exists: RESLIB }, options: "shr" }
- { name: "SYSLIB", dsn: "${HLQ}.OBJ", options: "shr" }
- { dsn: "${SCEELKED}", options: "shr" }
- { dsn: "${SDFHLOAD}", condition: "${IS_CICS}", options: "shr" }
- { dsn: "${SDSNLOAD}", condition: "${IS_SQL}", options: "shr" }