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


Preparing to use JCL samples in this collection

Reusable JCL collection

The reusable JCL collection consists of working samples of JCL that you can copy, edit, and reuse to quickly accomplish basic tasks on the job. Using these samples requires some basic knowledge of JCL techniques and of your own work environment; start with this checklist.

About this task
Although the samples in the reusable JCL collection are as complete as possible, and include line-by-line instructions and descriptions:
  • You need to understand the basic process for creating or editing JCL and submitting a job.
  • You need to memorize certain JCL techniques that are required for almost all of the JCL that you modify or write.
  • You must replace certain variables in the samples with company-specific information.
  • You will need to use additional reference materials if you want to significantly alter these reusable samples.
Before you begin to work with the JCL samples, use the following checklist to collect or learn what you need to know.
Procedure
  1. Complete or review the exercise described in JCL exercise: Creating and submitting a job, which takes you through the process of creating a data set member for JCL, coding JCL (using a predefined sample), submitting the job, and viewing the job output. Unless your mentor has already set up a JCL data set for you, you will need to create your own data set to contain any JCL you write or use, including any of the reusable samples in this collection.
  2. Make sure you have access to the latest editions of the following resources:
    • z/OS MVS™ JCL Guide (SA22-7598) and z/OS MVS JCL Reference (SA22-7597). The latter is an especially indispensable resource, containing detailed descriptions of JCL parameters and keywords.
    • z/OS MVS System Messages and z/OS MVS System Codes (SA22-7626). Both are useful for debugging error messages or return codes.
    All are available in several formats. Check for them online in the z/OS Internet Library:

    http://www.ibm.com/servers/eserver/zseries/zos/bkserv/

    You might need additional resources from the z/OS product library as well; any specific references are noted in the instructions for each sample.
  3. Memorize the names and functions of the five fields that constitute a JCL statement.
  4. Memorize the syntax rules for continuing JCL statements on more than one line. When you modify one of the reusable JCL samples, your changes often will make a complete JCL statement exceed 71 characters in length. When this happens, you must use multiple lines to complete the statement. To continue a JCL statement on one or more separate lines:
    1. In the parameter field of the JCL statement, end the line before reaching position 72, but after coding a complete parameter or subparameter and the comma that follows it.
    2. On the next line, code two forward slashes (//) in positions 1 and 2.
    3. Beginning in any position from 4 to 16, resume coding the JCL statement with the next complete parameter or subparameter.
    You also may use this technique to make your JCL more easily readable. This example illustrates a correctly coded multiple-line JCL statement:
    //NEWDS DD  DSNAME=ZUSER03.ACTDATA.LIST,DISP=(NEW,KEEP),
    //          DATACLAS=DSCLAS01,STORCLAS=STRCLS20
  5. Learn how to correctly code data set names on the DSNAME parameter (often abbreviated DSN) on data definition (DD) statements. Naming and syntax rules for coding data set names vary depending on the type of data set you are identifying.
    Table 1 lists the different types and examples of correctly coded names. Unless another resource is noted in the table, z/OS MVS JCL Reference (SA22-7597) is the definitive source for complete details about the data set types and permissible names, along with syntax rules.
    Table 1. Summary of data set types and correctly coded DSNAME (DSN) parameter values
    Type of data set DSNAME (DSN) parameter value formats and examples
    Permanent Unqualified names: One through 8 alphanumeric or special ($, #, @) characters, a hyphen, or a character X'C0'. The first character must be alphabetic or special ($, #, @).
    Example of an unqualified name:
    DSNAME=ALPHA
    Qualified names: Multiple unqualified names joined by periods. Each qualifier is coded like an unqualified name; therefore, the name must contain a period after every 8 characters or fewer. The maximum length of a qualified data set name is:
    • 44 characters, including periods.
    • For a generation data group, 35 characters, including periods.
    • For an output tape data set, 17 characters, including periods.
    Example of a qualified name:
    DSNAME=ALPHA.PGM
    RACF-protected data sets: Use the same format as for a qualified name, and make sure the high-level qualifier of the name is defined to RACF®. Further details are documented in z/OS Security Server RACF Security Administrator's Guide (SA22-7683).
    Formats for names of cataloged data sets:
    dsname
    dsname(member)
    dsname(gen_data_group)
    dsname(INDEX | PRIME | OVFLOW)
    Example for a cataloged data set:
    DSNAME=LIB1(PROG12)
    Further details are documented in z/OS DFSMS™ Access Method Services for Catalogs (SC26-7394).
    Temporary When you define a temporary data set, you can code the DSNAME parameter or omit it; in either case, the system generates a qualified name for the temporary data set.
    When you use the DSNAME parameter for a temporary data set, code the name as two ampersands (&&) followed by a character string 1 to 8 characters in length:
    • The first character following the ampersands must be alphabetic or special ($, #, @).
    • The remaining characters must be alphanumeric or special ($, #, @).
    Formats for temporary data set names:
    &&dsname
    &&dsname(member)
    &&dsname(INDEX | PRIME | OVFLOW)
    Example for a temporary data set:
    //DD3 DD DSNAME=&&WORK,UNIT=3420
    In-stream or system output (sysout) When defining an in-stream or sysout data set, you can code the DSNAME parameter or omit it; if omitted, the system generates a name for the data set.

    The data set name for in-stream and sysout data sets consists of two ampersands (&&) followed by one through eight 8 alphanumeric or special ($, #, @) characters, a hyphen, or a character X'C0'. The first character following the ampersands must be alphabetic or special ($, #, @).

    Example for an in-stream data set:
    //DDIN DD DATA,DSNAME=&&PAYIN1
    Example for a sysout data set:
    //DDOUT DD DSNAME=&&PAYOUT1,SYSOUT=P
    Backward reference A backward reference is a reference to an earlier statement in the job or in a cataloged or in-stream procedure called by this or an earlier job step. A backward reference can be coded in the DSNAME parameter to copy a data set name from an earlier DD statement.
    Formats for backward references:
    *.ddname 
    *.stepname.ddname 
    *.stepname.procstepname.ddname 
    Example of a backward reference in DD5 statement in STEP2:
    //STEP1 EXEC PGM=CREATE 
    //DD4   DD DSNAME=&&ISDATA(PRIME),DISP=(,PASS),
    //         UNIT=(3350,2),VOLUME=SER=334859,
    //         SPACE=(CYL,(10,,2),,CONTIG),DCB=DSORG=IS 
    //STEP2 EXEC PGM=OPER 
    //DD5   DD DSNAME=*.STEP1.DD4,DISP=(OLD,DELETE)
    Dummy data set The parameter NULLFILE specifies a dummy data set. NULLFILE has the same effect as coding the DD DUMMY parameter.
  6. Ask your system programmer or mentor to help you complete the following list, which identifies elements of your work environment that might affect the JCL that you code. Use Table 2 to record your answers. When this worksheet is complete, you should have the company-specific information you need for most of the jobs you will run on z/OS.
    • Determine which job entry subsystem (JES2 or JES3) is installed on the z/OS system you will use. For many jobs, the type of JES does not affect JCL parameters; for certain jobs, however, the JES in use does dictate which JCL parameters, values, or job entry control (JECL) statements you may code.
    • Determine which access methods your company uses for its data sets. An access method defines the technique that is used to store and retrieve data. Access methods have their own data set structures to organize data, system-provided programs (or macros) to define data sets, and utility programs to process data sets. Access methods, therefore, determine which JCL parameters and parameter values that you need to code.
    • For direct-access storage devices (DASD), determine which naming conventions are used, as well as default or recommended values for data set attributes.
    • For storing or backing up data on tape, determine which tape device volume numbers and types are available for your use.
    • Determine whether your company uses the Storage Management Subsystem (SMS) to automate the use of storage for data sets. The JCL parameters for SMS-managed (also called system-managed) data sets are different from some parameters used for non-SMS data sets.
    • Determine the information (account number, programmer name, and so on) your company requires for each job that you submit.
    Table 2. JCL worksheet
    Company convention or z/OS environment specifics Notes® / Values to code on JCL statements
    Job entry subsystem

    JES2
      or
    JES3

     
    Access methods

    Queued Sequential (QSAM)
    Basic Partitioned  (BPAM)
    Virtual Sequential (VSAM)
    Basic Sequential (BSAM)
    Basic Direct (BDAM)

     
    Direct-access storage devices (DASD)

    DSN=

    UNIT=

    VOL=SER=

    Magnetic tape devices

    LABEL=

    UNIT=

    VOL=SER=

    Data management system
    Conventions for SMS-managed data sets
      Average record AVGREC=
      Data classes DATACLAS=
      Management classes MGMTCLAS=
      RACF profile names SECMODEL=
      Storage classes STORCLAS=
    Conventions for non-SMS-managed data sets
      Data set attributes or requirements BLKSIZE
      LRECL=
      RECFM
      SPACE=
      SYSOUT=
    Conventions for the JOB statement
      Account number  
      Other accounting information  
      Programmer name  
      Class CLASS=
      Message class MSGCLASS=
      Message level MSGLEVEL=
      Region size REGION=
      Time limit TIME=

Go to the previous page   |   Go to the next page




Copyright IBM Corporation 1990, 2010