Language task: CobolTestcase.yaml

Description

This sample provides the language task configuration to compile COBOL testcases 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 to dataset.
    • Compile COBOL.
    • Perform link-edit.

Define sources

Define sources as a list of file patterns to locate COBOL testcases within the build list.

sources:
  - "**/testcase/*.cbl"

Task variables

Required variables

compileParms

Type: String
Default: ""
Conditional variable which builds the compile parameters based on scanned or defined file type, e.g. CICS, SQL

- 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

linkEditParms

Type: String
Default: MAP,RENT,COMPAT(PM5)
Link-edit parameters.

Create datasets

Create datasets which must exist and be validated prior to compile.

datasets:
  - name: ${HLQ}.TEST.COBOL
    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}.TEST.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 copySrcTest copies the current build file from its HFS source to the dataset //'${HLQ}.TEST.COBOL(${MEMBER})'.

- step: copySrcTest
  type: copy
  source: ${WORKSPACE}/${FILE}
  target: //'${HLQ}.TEST.COBOL(${MEMBER})'

Compile step

The mvs step compileTest calls IGYCRCTL to compile the test case.

- step: compileTest
  type: mvs
  pgm: IGYCRCTL
  parm: ${compileParms}
  maxRC: 8
  dds:
    - { name: "SYSIN", dsn: "${HLQ}.TEST.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: "${SBZUSAMP}", 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" }