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


Reusable JCL: Copying a load module

Reusable JCL collection

Modify this JCL sample to copy one load module from one cataloged partitioned data set (PDS) to another existing PDS, using the DFSMSdfp™ utility IEBCOPY.

Before you begin
  • If you have not already done so, allocate a data set to contain your modified version of this JCL sample. Use the instructions in JCL exercise: Creating and submitting a job to create this data set.
  • Determine the information (account number, programmer name, and so on) your company requires for each job that you submit.
  • For direct-access storage devices (DASD), determine which naming conventions are used, as well as default or recommended values for data set attributes.
  • 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 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.
About this task
The steps that follow provide line-by-line instructions for modifying this JCL sample:
//jobname  JOB  (start of JOB statement parameters)
//stepname EXEC PGM=IEBCOPY,REGION=4M
/*JOBPARM SYSAFF=*,LINES=99
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=dsname,DISP=SHR
//SYSUT2   DD DSN=dsname,DISP=SHR,
//     UNIT=unit,
//     VOL=SER=volser
//SYSUT3   DD UNIT=VIO,SPACE=(CYL,(10))
//SYSUT4   DD UNIT=VIO,SPACE=(CYL,(10))
//SYSIN    DD *
  COPYMOD INDD=SYSUT1,OUTDD=SYSUT2,MAXBLK=32760
  SELECT M=(membername)
/*
In the JCL statements that appear in code examples, lowercase text indicates items that you need to modify. Except for a few cases, lowercase alphabetic characters cannot be used in JCL.
All jobs require JOB and EXEC statements, so this sample contains both:
  • The JOB statement marks the beginning of a job, specifies the job name, and also might provide company-specific details or JCL parameters that apply to all job steps within the job.
  • The EXEC statement marks the beginning of a job step. In this case, the job step is to run IEBCOPY, which is a DFSMSdfp utility for copying or merging full or partial members between one or more partitioned data sets.
When you use the IEBCOPY utility, you must define several input and output data definition (DD) statements in the job step:
  • The SYSPRINT DD statement tells the system where to print the informational or error messages from IEBCOPY.
  • The SYSUT1 DD statement identifies the input data set where your load module resides.
  • The SYSUT2 DD statement identifies the output data set where the copy of your load module is to be placed.
  • The SYSIN DD statement contains instructions for IEBCOPY to process.

You also may define two optional spill data sets on a virtual I/O (VIO) device; these temporary data sets are used only when an insufficient amount of virtual storage is available for some or all of the current input data set directory entries, or for the output data set directory. This JCL sample contains DD statements for both of these temporary data sets.

If you modify this sample to complete more complex tasks, or if you encounter JCL errors, see z/OS MVS™ JCL Reference (SA22-7597), which is the comprehensive source of syntax rules and statement parameter descriptions.

Another useful reference is z/OS DFSMSdfp Utilities (SC26-7414), which contains information about using IEBCOPY.

Procedure
  1. Required: Modify the JOB statement to uniquely identify your job and to provide additional company-specific information.
    //jobname  JOB  (start of JOB statement parameters)
    1. Replace jobname with a unique name to identify this job. A common convention is to use your TSO logon ID followed by a number (for example: ZUSER031).
      Syntax rules for the name field are:
      • The name must begin in column 3 of the JCL statement.
      • The name can be one through eight characters in length.
      • The first character in the name must be an alphabetic character (the letters A through Z) or a special character (the symbols #, @, and $).
      • The remaining characters can be alphanumeric (the letters A through Z and numbers 0 through 9) or special characters.
      • Blank spaces cannot be included in a name.
    2. Replace (start of JOB statement parameters) with parameters and values that conform to guidelines set at your company.
  2. Required: Modify the EXEC statement to uniquely identify the job step and the utility to be run.
    //stepname EXEC PGM=IEBCOPY
    1. Replace stepname with a unique name to identify this step. Syntax rules for stepname are identical to those listed for jobname. Aside from changing the step name, no further changes are required.
  3. Optional: Override company-defined default values for maximum lines of output, for the system on which this job is to run, or both. If you do not want to override these default values, remove this line of code from the sample.
    To override defaults on this job entry subsystem: Use this job entry control language (JECL) statement:
    JES2
    /*JOBPARM SYSAFF=*,LINES=99
    JES3
    //*MAIN SYSTEM=JLOCAL,LINES=99
    • The SYSAFF or SYSTEM parameter ensures that the conversion and execution of the job will be done on a specific system. Specifying SYSAFF=* or SYSTEM=JLOCAL means that the job will be run on the system into which the job is read.
    • The LINES parameter specifies the maximum output, in thousands of lines, that the job entry subsystem is to allow on spool data sets for this job's sysout data sets.

    Note the syntax rules for the JES3 //*MAIN statement: Place the characters //* in columns 1 through 3, MAIN in columns 4 through 7, a blank in column 8, and parameters beginning in column 9.

  4. Required: Include a SYSPRINT DD statement to tell the system where to print IEBCOPY messages.
    //SYSPRINT DD SYSOUT=*
    The SYSPRINT DD statement with SYSOUT=* tells the system to print the informational or error messages from IEBCOPY in the job log. Although you may use other parameter values for SYSPRINT, no changes are required for this DD statement.
  5. Required: Modify this input DD statement to identify the partitioned data set that contains the load module that you want to copy, and the data set disposition.
    //SYSUT1   DD DSN=dsname,DISP=SHR
    1. You may replace SYSUT1 as the label (or ddname) for this JCL DD statement. If you use a ddname other than SYSUT1, you must also replace SYSUT1 on the SYSIN DD statement with the new ddname.

      Syntax rules for ddnames are identical to those listed for job and step names on JOB and EXEC statements. By default, SYSUT1 is used as the ddname for the DD statement that identifies the input data set.

    2. Replace dsname with the name of the data set that contains the load module. This sample assumes that your input data set is cataloged. If you are copying a load module from an uncataloged data set that is not SMS-managed, you must add the UNIT parameter to this input DD statement; you might need to add the VOL=SER parameter as well. Use the instructions in the following step (modifying the output DD statement SYSUT2) for providingUNIT and VOL=SER parameter values.
    3. Change the value for the DISP parameter, if necessary. The DISP parameter tells the system about the status of your data set and what to do with it when your job ends, either normally or abnormally. As coded in this sample, the status subparameter value SHR tells the system that your data set already exists, and can be used by other programs while your job is running. The subparameter values for job-end processing are not specified, so default values are in effect. Whether the job ends normally or not, the system will keep, rather than delete, this data set. No changes are required for this parameter.

      If you want to understand more about disposition processing, refer to the summary of disposition processing in z/OS MVS JCL Reference (SA22-7597), in the DD statement topic for the DISP parameter.

  6. Required: Modify this output DD statement to identify the partitioned data set to which IEBCOPY is to copy the load module, the data set disposition, and the device on which the data set resides.
    //SYSUT2   DD DSN=dsname,DISP=SHR,
    //     UNIT=unit,
    //     VOL=SER=volser
    1. You may replace SYSUT2 as the label (or ddname) for this JCL DD statement. If you use a ddname other than SYSUT2, you must also replace SYSUT2 on the SYSIN DD statement with the new ddname.

      By default, SYSUT2 is used as the ddname for the DD statement that identifies the output data set.

    2. Replace dsname with the name of the data set into which IEBCOPY is to copy the load module. Remember, this output data set must exist before you run this job.
    3. Change the value for the DISP parameter, if necessary. The disposition in this sample is share (DISP=SHR) so that other programs can use the data set while this job is running. The subparameter values for job-end processing are not specified, so default values are in effect. Whether the job ends normally or not, the system will keep, rather than delete, this data set. No changes are required for this parameter.

    The remaining parameters that you use for the output DD statement depend on whether your company uses the Storage Management Subsystem (SMS).

    • If you are using SMS, replace the UNIT and VOL=SER parameters with the STORCLAS parameter and a storage class name that your company uses for PDSes (for example, STORCLAS=SCLAS01).
    • If you are not using SMS:
      • Replace the UNIT parameter value unit with an appropriate value, which usually is the symbolic name of a group of devices; for example, UNIT=SYSALLDA (SYSALLDA is an IBM-assigned group name that contains all direct access devices defined to the system).
      • Check with your mentor to determine whether you need to specify the VOL=SER parameter; company guidelines determine what you supply for it.
  7. Optional: Remove or modify the DD statements that define temporary data sets for this copy operation.
    //SYSUT3   DD UNIT=VIO,SPACE=(CYL,(10))
    //SYSUT4   DD UNIT=VIO,SPACE=(CYL,(10))
    SYSUT3 defines an optional spill data set on a virtual I/O (VIO) device. SYSUT3 is used only when an insufficient amount of virtual storage is available for some or all of the current input data set directory entries. Similarly, SYSUT4 defines an optional spill data set to be used only when an insufficient amount of virtual storage is available for the output data set directory.

    This sample's SYSUT3 and SYSUT4 DD statements tell the system to allocate 10 cylinders of space for the temporary VIO data sets. If you use these two DD statements, you must replace at least the value specified for the UNIT parameter; companies typically choose their own unit name for VIO devices. Ask your mentor for advice about coding these temporary data sets.

  8. Required: Modify the SYSIN DD statement, which contains instructions for IEBCOPY to process.
    //SYSIN    DD *
      COPYMOD INDD=SYSUT1,OUTDD=SYSUT2,MAXBLK=32760
      SELECT M=(membername)
    /*
    The SYSIN DD statement identifies an in-stream data set as the source of input for IEBCOPY to process. DD * or DD DATA marks the beginning of the in-stream data set; the delimiter /* marks the end of data.
    The instream data set in this sample contains two job control statements for IEBCOPY:
    • The COPYMOD statement tells IEBCOPY not only to copy your load module, but also to reblock it on the data set to which it will be copied. Reblocking is usually done to make the record length of the output data set compatible with different devices or programs. Reblocking must be done if the input data set has a larger block size than the output data set.
      • If you used a ddname other than SYSUT1 for your input data set DD statement, replace SYSUT1 with that new ddname.
      • If you used a ddname other than SYSUT2 for your output data set DD statement, replace SYSUT2 with that new ddname.
      • MAXBLK specifies the maximum block size for records in the output partitioned data set. This sample shows a MAXBLK value in decimal form; instead, you may use the nnK format where nn is a decimal number and the letter K indicates that the nn value is to be multiplied by 1024 bytes.
      If your changes make the COPYMOD statement exceed 71 characters in length, note that continuation rules are slightly different than those for continuing other JCL statements on subsequent lines:
      • End the first line with a comma that separates parameters, pad with blanks out to column 72, and place a nonblank character in column 72.
      • Start the next line in column 16 with a parameter and its value.
    • The SELECT statement identifies which member of the input data set is to be loaded. Replace membername with the name of the load module that you want IEBCOPY to copy.
  9. Optional: Check for JCL syntax errors by submitting the job with TYPRUN=SCAN on the JOB statement.
    //jobname  JOB  (start of JOB statement parameters),TYPRUN=SCAN
    Using TYPRUN=SCAN does not catch all possible JCL errors, but it's a good start to ensuring that your job will run. TYPRUN=SCAN requests that the system scan this job's JCL for syntax errors, without executing the job or allocating devices. This parameter asks the system to check for:
    • Spelling of parameters and some subparameters that is not correct.
    • Characters that are not correct.
    • Unbalanced parentheses.
    • Misplaced positional parameters on some statements.
    • In a JES3 system only, parameter value errors or excessive parameters.
    • Incorrect syntax on JCL statements in cataloged procedures invoked by any scanned EXEC statements.

    You might still encounter JCL errors after using TYPRUN=SCAN, because this request checks the JCL only through the converter, not the interpreter. The difference is that the converter basically checks all expressions to the left of an equal sign plus some expressions to the right of an equal sign (and issues messages that start with IEFC), while the interpreter checks all expressions to the right of an equal sign (and issues messages that start with IEF). For example, a data set name containing a qualifier that exceeds eight characters, such as DSN=L9755TB.JCL.TEST19970103 would not be flagged by TYPRUN=SCAN but would be caught by the interpreter.

  10. Required: Remove TYPRUN=SCAN from the JOB statement and submit the job. The system response is:
    JOB jobname(jobnumber) SUBMITTED
    ***
Results
When the job ends, you will receive a message indicating one of three conditions: job successful, JCL error, or program abend. Use your installation's viewing facility (for example, SDSF) to view the output and determine whether the job completed successfully.

One possible error condition that you might encounter is a region size that is too small to successfully complete the job step. If your job ends with system completion code 804 or 80A, which result when this condition is true, you can add a REGION parameter to the EXEC statement and resubmit the job. The optional REGION parameter overrides the default limit of storage that the system allocates to a particular job step. Check with your mentor to determine an appropriate value to specify for REGION; it is not a parameter to be used without advice.





Copyright IBM Corporation 1990, 2010