Reusable JCL collection
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


JCL DD statements: Advantages of using symbolic names

Reusable JCL collection

When you use symbolic names to identify individual DD statements in JCL, you can improve the reusability of programs. Here's how it works.

When you use symbolic names for DD statements in JCL, you can improve the reusability of programs by changing data set information without having to recompile the programs that access the data set.

For example, suppose that your company uses a payroll program to record its employees' pay. Each month, you have to run the program to update pay records, using a different data set each time. In the program code, the program uses the name "PAY" to refer to the data set. Instead of changing the program each month to use a different data set name, you can use "PAY" as the label in the name field (or ddname) for the JCL DD statement that identifies the payroll data set to be used. So instead of changing and recompiling the payroll program, you make only minor changes to your JCL.

The first time you run the program, your JCL looks like the JCL in Figure 1.
Figure 1. Symbolic file name: Payroll program and MY.PAYROLL data set
The next time, when the payroll data set changes to DIV1.PAYROLL, you change only the DSN parameter value on the DD statement, and the payroll program can continue to use the same ddname (PAY). Your JCL now looks like the JCL in Figure 2.
Figure 2. Symbolic file name: Payroll program and new DIV1.PAYROLL data set
The ddname connects a program reference to a data set to the data set description (that is, the DD statement) in the JCL. So the ddname "PAY" is a symbolic name that the payroll program uses, and the DSNAME parameter in the JCL identifies the real name of the data set.

The use of symbolic file names is another defining characteristic of the z/OS® operating system. It applies a naming redirection between a data set-related name used in a program and the actual data set used during execution of that program. This redirection allows the program to be used to process different input data sets simply by changing the DSNAME in the JCL. This ability becomes significant for large commercial applications that might use dozens of data sets in a single execution of the program.

The format for coding program references depends on the language in which the program is written. For example:
In a COBOL program
The ASSIGN clause in the Environment Division identifies the DDNAME that must be used in the DD statement.
SELECT FILEIN ASSIGN TO PAY...
In an Assembler program
The DDNAME is indicated as a keyword parameter of the DCB macro.
FILEIN DCB DDNAME=PAY,...
IBM® reserves the following list of DD names for optional, special-function DD statements:
JOBLIB
A JOBLIB DD statement, placed just after a JOB statement, specifies a library that should be searched first for the programs executed by this job.
STEPLIB
A STEPLIB DD statement, placed just after an EXEC statement, specifies a library that should be searched first for the program executed by the EXEC statement. A STEPLIB overrides a JOBLIB if both are used.
JOBCAT and STEPCAT
JOBCAT and STEPCAT are used to specify private catalogs, but these are rarely used (the most recent z/OS releases no longer support private catalogs). Nevertheless, these DD names should be treated as reserved names.
SYSABEND, SYSUDUMP, SYSMDUMP and CEEDUMP
The SYSABEND, SYSUDUMP, SYSMDUMP, and CEEDUMP DD statements are used for various types of memory dumps that are generated when a program abnormally ends.




Copyright IBM Corporation 1990, 2010