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. 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 can be KSDS, ESDS, RRDS or LDS. The following examples are done with DEFINE ALTERNATEINDEX but can be transposed with DEFINE AIX:

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))