CTL

Control Card (CTL) is the datasets (can also be an instream data) which has the information likes SYSIN, SYSTIN, etc. It also provides information specific to a particular program in a format that the program writer defines. For example, DFSORT has control statements such as SORT, MERGE, INCLUDE, OMIT, INREC, OUTREC, SUM, OUTFIL, OPTION, etc. These are all defined in "z/OS DFSORT Application Programming Guide"

Partitioned Data Set

Partitioned Data Set (PDS) is a mainframe dataset that acts as a library or container (folder) for multiple members (files). 
A PDS object definition is created for any folder containing a control card (.CTL file), provided the folder name is a valid PDS name. 

Example: 
If a control card file exists in the folder MY.LIB.AWS, the following PDS object is created:

{

"name": "MY.LIB.AWS",
"path": "Global:PDS:MY.LIB.AWS",
"type": "PDS"
}

PDS Name Validation

  • Not exceeding 44 characters in total length
  • Consists of qualifiers separated by dots (.)
  • Each qualifier must:
    • Start with an alphabetic character (A-Z) or special character (@, #, $)
    • Contain only alphanumeric characters (A-Z, 0-9) or special characters (@, #, $)
    • Not exceeding 8 characters
  • Contain at least one dot (i.e., at least two qualifiers)

Valid examples: YI.D.STEUKA, @WS.M2.CARDDEMO.LOADLIB, SYS1#.PROCLIB

Linkage Editor Control Statements

Include Statements

INCLUDE statement implies dependencies on “Program” file.

  • INCLUDE PROGRAM
  • INCLUDE LIBRARY(PROGRAM)

Where program is the name of the Program (COBOL, JCL, PROC, REXX, PL1, RPG, ASM, LNK, EZT or CTL) in the project. LIBRARY is the user specified sub-library. Example for the library are PRODLIB, MODLIB.

VSAM Datasets

Datasets are oftenly defined in CSD but it's also possible to declare particular datasets in CTL, like VSAM ones.

Define Cluster

The DEFINE CLUSTER or DEFINE CL commands will create an object with the type DATASET and VSAM <vsam type> where vsam type can be KSDS, ESDS, RRDS or LDS. When none of the keywords described below is present, the cluster defaults to VSAM KSDS. The following examples are done with DEFINE CLUSTER but can be transposed with DEFINE CL:

KSDS

Here, the keyword INDEXED indicates that it's a VSAM KSDS. This bunch of code will create an object with both type VSAM KSDS and DATASET. If the dataset already exists, we will add the type VSAM KSDS to it. The INDEXED property can also be found as IXD.

DEFINE CLUSTER(NAME(MY.VSAM.CLUSTER) -
           INDEXED -
           CYL(15 3) -
           RECORDSIZE(18 18) -
           KEYS(12 0) FSPC(09 10) -
           CISZ(4096)) -
         DATA(NAME(MY.VSAM.CLUSTER.DATA)) -
         INDEX(NAME(MY.VSAM.CLUSTER.INDEX))

ESDS

Here, the keyword NONINDEXED indicates that it's a VSAM ESDS. This bunch of code will create an object with both type VSAM ESDS and DATASET. If the dataset already exists, we will add the type VSAM ESDS to it. The NONINDEXED property can also be found as NIXD.

DEFINE CLUSTER(NAME(MY.VSAM.CLUSTER) -
           NONINDEXED -
           CYL(15 3) -
           RECORDSIZE(18 18) -
           KEYS(12 0) FSPC(09 10) -
           CISZ(4096)) -
         DATA(NAME(MY.VSAM.CLUSTER.DATA)) -
         INDEX(NAME(MY.VSAM.CLUSTER.INDEX))

RRDS

Here, the keyword NUMBERED indicates that it's a VSAM RRDS. This bunch of code will create an object with both type VSAM RRDS and DATASET. If the dataset already exists, we will add the type VSAM RRDS to it. The NUMBERED property can also be found as NUMD.

DEFINE CLUSTER(NAME(MY.VSAM.CLUSTER) -
           NUMBERED -
           CYL(15 3) -
           RECORDSIZE(18 18) -
           KEYS(12 0) FSPC(09 10) -
           CISZ(4096)) -
         DATA(NAME(MY.VSAM.CLUSTER.DATA)) -
         INDEX(NAME(MY.VSAM.CLUSTER.INDEX))

LDS

Here, the keyword LINEAR indicates that it's a VSAM LDS. This bunch of code will create an object with both type VSAM LDS and DATASET. If the dataset already exists, we will add the type VSAM LDS to it. The LINEAR property can also be found as LIN.

DEFINE CLUSTER(NAME(MY.VSAM.CLUSTER) -
           LINEAR -
           CYL(15 3) -
           RECORDSIZE(18 18) -
           KEYS(12 0) FSPC(09 10) -
           CISZ(4096)) -
         DATA(NAME(MY.VSAM.CLUSTER.DATA)) -
         INDEX(NAME(MY.VSAM.CLUSTER.INDEX))

Define Alternateindex

The DEFINE ALTERNATEINDEX or DEFINE AIX commands will create an object with the type DATASET and VSAM <vsam type> where vsam type is AIX by default, or KSDS, ESDS, RRDS or LDS when the corresponding keyword is present. The DATA(...) and INDEX(...) components are optional. The following examples are done with DEFINE ALTERNATEINDEX but can be transposed with DEFINE AIX:

AIX

Here, no organisation keyword (INDEXED, NONINDEXED, NUMBERED, LINEAR or their short forms) is present, so it's a VSAM alternate index. This bunch of code will create an object with both type VSAM AIX and DATASET. If the dataset already exists, we will add the type VSAM AIX to it.

DEFINE ALTERNATEINDEX(NAME(MY.VSAM.CLUSTER) -
           CYL(15 3) -
           RECORDSIZE(18 18) -
           KEYS(12 0) FSPC(09 10) -
           CISZ(4096)) -
         DATA(NAME(MY.VSAM.CLUSTER.DATA)) -
         INDEX(NAME(MY.VSAM.CLUSTER.INDEX))

Creates:

{
    "dependencyType": "Define DATASET",
    "name": "MY.VSAM.CLUSTER",
    "path": "Global:DATASET:MY.VSAM.CLUSTER",
    "type": "VSAM AIX DATASET"
}

KSDS

Here, the keyword INDEXED indicates that it's a VSAM KSDS. This bunch of code will create an object with both type VSAM KSDS and DATASET. If the dataset already exists, we will add the type VSAM KSDS to it. The INDEXED property can also be found as IXD.

DEFINE ALTERNATEINDEX(NAME(MY.VSAM.CLUSTER) -
           INDEXED -
           CYL(15 3) -
           RECORDSIZE(18 18) -
           KEYS(12 0) FSPC(09 10) -
           CISZ(4096)) -
         DATA(NAME(MY.VSAM.CLUSTER.DATA)) -
         INDEX(NAME(MY.VSAM.CLUSTER.INDEX))

ESDS

Here, the keyword NONINDEXED indicates that it's a VSAM ESDS. This bunch of code will create an object with both type VSAM ESDS and DATASET. If the dataset already exists, we will add the type VSAM ESDS to it. The NONINDEXED property can also be found as NIXD.

DEFINE ALTERNATEINDEX(NAME(MY.VSAM.CLUSTER) -
           NONINDEXED -
           CYL(15 3) -
           RECORDSIZE(18 18) -
           KEYS(12 0) FSPC(09 10) -
           CISZ(4096)) -
         DATA(NAME(MY.VSAM.CLUSTER.DATA)) -
         INDEX(NAME(MY.VSAM.CLUSTER.INDEX))

RRDS

Here, the keyword NUMBERED indicates that it's a VSAM RRDS. This bunch of code will create an object with both type VSAM RRDS and DATASET. If the dataset already exists, we will add the type VSAM RRDS to it. The NUMBERED property can also be found as NUMD.

DEFINE ALTERNATEINDEX(NAME(MY.VSAM.CLUSTER) -
           NUMBERED -
           CYL(15 3) -
           RECORDSIZE(18 18) -
           KEYS(12 0) FSPC(09 10) -
           CISZ(4096)) -
         DATA(NAME(MY.VSAM.CLUSTER.DATA)) -
         INDEX(NAME(MY.VSAM.CLUSTER.INDEX))

LDS

Here, the keyword LINEAR indicates that it's a VSAM LDS. This bunch of code will create an object with both type VSAM LDS and DATASET. If the dataset already exists, we will add the type VSAM LDS to it. The LINEAR property can also be found as LIN.

DEFINE ALTERNATEINDEX(NAME(MY.VSAM.CLUSTER) -
           LINEAR -
           CYL(15 3) -
           RECORDSIZE(18 18) -
           KEYS(12 0) FSPC(09 10) -
           CISZ(4096)) -
         DATA(NAME(MY.VSAM.CLUSTER.DATA)) -
         INDEX(NAME(MY.VSAM.CLUSTER.INDEX))

Define Generationdatagroup

The DEFINE GENERATIONDATAGROUP or DEFINE GDG commands will create an object with the type DATASET and GDG BASE, and a "Define DATASET" dependency from the control card. Generation references to this base in JCL and PROC files, such as DSN=MY.GDG.BASE(+1), are linked to the GDG base node (see the DD DSN section of the JCL page).

DEFINE GENERATIONDATAGROUP(NAME(MY.GDG.BASE) -
           LIMIT(10) -
           SCRATCH -
           EMPTY)

Creates:

{
    "dependencyType": "Define DATASET",
    "name": "MY.GDG.BASE",
    "path": "Global:DATASET:MY.GDG.BASE",
    "type": "GDG BASE"
}

BLDINDEX / REPRO

In a BLDINDEX or REPRO command, INDATASET(dataset-name) implies a dependency of type "Read Dataset" and OUTDATASET(dataset-name) a dependency of type "Write Dataset" on a DATASET object. Only the full keywords are recognised: the abbreviations IDS / ODS and the DD name forms INFILE / OUTFILE create no dependency. A dataset that is not in the codebase is reported as "Missing Dataset".

BLDINDEX INDATASET(MY.VSAM.CLUSTER) -
         OUTDATASET(MY.VSAM.AIX)

Creates a "Read Dataset" dependency on MY.VSAM.CLUSTER and a "Write Dataset" dependency on MY.VSAM.AIX.