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


Reusable JCL: Deleting some VSAM clusters

Reusable JCL collection

Modify this JCL sample to delete one or more VSAM clusters, using DFSMSdfp™ access method services (IDCAMS).

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.
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=IDCAMS
//SYSPRINT DD  SYSOUT=* 
//SYSIN    DD  * 
  DELETE 'entryname'   
  DELETE 'entryname,entryname,entryname' 
/*
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 access method services, which is a DFSMSdfp utility for managing catalogs. IDCAMS is its program name.
When you use the access method services through JCL, you must define two specific DD statements in the job step:
  • The SYSPRINT DD parameter tells the system where to print IDCAMS messages.
  • The SYSIN DD statement identifies an in-stream data set containing input for access method services to process.

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 DFSMS™ Access Method Services for Catalogs (SC26-7394), which contains background information about VSAM clusters and details about using IDCAMS for other operations.

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: Replace stepname with a unique name to identify this step.
    //stepname EXEC PGM=IDCAMS
    Syntax rules for stepname are identical to those listed for jobname. Aside from changing the step name, no further changes are required.
  3. Required: Use the SYSPRINT DD parameter to tell the system where to print IDCAMS messages.
    //SYSPRINT DD  SYSOUT=*
    The SYSPRINT DD statement with SYSOUT=* tells the system to print the informational or error messages from IDCAMS in the job log. Although you may use other parameter values for SYSPRINT, no changes are required for this DD statement.
  4. Required: Use the SYSIN DD statement to identify an in-stream data set as the source of input for access method services to process.
    //SYSIN    DD  * 
      DELETE 'entryname'   
      DELETE 'entryname,entryname,entryname' 
    /*
    DD * or DD DATA marks the beginning of the in-stream data set; the delimiter /* marks the end of data.
    Replace entryname with the names of clusters that you want to delete. As coded in this sample, the DELETE commands illustrate two of several possible formats for specifying entries on this access methods services command:
    • The first DELETE command specifies only one entry to be deleted; for example: DELETE 'DB8YU.DSNDBC.CC390'
    • The second DELETE command lists several entries to be deleted. Multiple entries must be enclosed in quotes (as shown above), and separated by a comma.
    If your changes make the DELETE statement exceed 71 characters in length, note that continuation rules are slightly different than those for continuing other JCL statements on subsequent lines. To continue a command on several lines, type either a hyphen or a plus sign as the last nonblank character before, or in, column 72:
    • A hyphen continues the command after a completely specified value:
      DELETE entryname-
             entryname
    • A plus sign continues both the command and a value within the command:
      DELETE entry+
             name
  5. 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.

  6. 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.




Copyright IBM Corporation 1990, 2010