z/os job control language - bücher … job control language. fifth edition. ... chapter 14...

15
z/OS JOB CONTROL LANGUAGE FIFTH EDITION Gary DeWard Brown John Wiley & Sons, Inc.

Upload: doananh

Post on 11-May-2018

216 views

Category:

Documents


2 download

TRANSCRIPT

  • z/OS JOB CONTROL LANGUAGE

    F IFTH EDIT ION

    Gary DeWard Brown

    John Wiley & Sons, Inc.

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page i

    Innodata0471426733.jpg

  • 9228 Brown/JCL IDX.k.qxd 5/1/02 11:53 AM Page 482

  • z/OS JOB CONTROL LANGUAGE

    F IFTH EDIT ION

    Gary DeWard Brown

    John Wiley & Sons, Inc.

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page i

  • Publisher: Robert IpsenEditor: Margaret EldridgeDevelopmental Editor: Kathryn A. MalmAssociate Managing Editor: Penny LinskeyNew Media Editor: Brian SnappText Design & Composition: North Market Street Graphics

    Designations used by companies to distinguish their products are often claimed astrademarks. In all instances where John Wiley & Sons, Inc., is aware of a claim, theproduct names appear in initial capital or ALL CAPITAL LETTERS. Readers, however,should contact the appropriate companies for more complete information regardingtrademarks and registration.

    This book is printed on acid-free paper. Copyright 2002 by Gary DeWard Brown. All rights reserved.

    Published by John Wiley & Sons, Inc.,Published simultaneously in Canada.

    No part of this publication may be reproduced, stored in a retrieval system or trans-mitted in any form or by any means, electronic, mechanical, photocopying, record-ing, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976United States Copyright Act, without either the prior written permission of the Pub-lisher, or authorization through payment of the appropriate per-copy fee to the Copy-right Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax(978) 750-4744. Requests to the Publisher for permission should be addressed to thePermissions Department, John Wiley & Sons, Inc., 605 Third Avenue, New York, NY10158-0012, (212) 850-6011, fax (212) 850-6008, E-Mail: [email protected].

    This publication is designed to provide accurate and authoritative information inregard to the subject matter covered. It is sold with the understanding that the pub-lisher is not engaged in professional services. If professional advice or other expertassistance is required, the services of a competent professional person should besought.

    Library of Congress Cataloging-in-Publication Data:ISBN 0471-236357

    Printed in the United States of America.

    10 9 8 7 6 5 4 3 2 1

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page ii

  • CONTENTS

    Preface ix

    Job Control Language Parameters xi

    Chapter 1 Introduction 11.1 The Shock of JCL 11.2 The Role of JCL 31.3 The Difficulty of JCL 31.4 The Approach to JCL 4

    Chapter 2 Introduction to JCL and z/OS 62.1 z/OS Concepts and Vocabulary 62.2 z/OS Hardware Architecture 102.3 Computer Data 262.4 Data Storage 33

    Chapter 3 JCL within a Job 353.1 JCL Statements 353.2 Computer Jobs 363.3 Creating Programs 413.4 Sort Example 423.5 Compile, Linkage Edit, Execute Example 453.6 Cataloged Procedure 50

    Chapter 4 JCL Statement Formats and Rules 514.1 JCL Statement Format 514.2 Parameters in the Operand Field 534.3 Parameter Rules 53

    iii

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page iii

  • 4.4 General JCL Rules 544.5 Continuing JCL Statements 554.6 Commenting JCL 564.7 Style in Writing JCL 574.8 Placement of JCL Statements 58

    Chapter 5 The JOB Statement 605.1 Jobname: Name of Job 625.2 Accounting Information 635.3 Name: Programmer Name 645.4 CLASS: Job Class 645.5 TIME: Time Limit 655.6 MSGCLASS: System Messages 675.7 MSGLEVEL: Printing JCL Statements 725.8 TYPRUN: Special Job Processing 73

    Exercises 74

    Chapter 6 The EXEC Statement 776.1 Stepname: Name of Job Step 786.2 PGM: Name of Program 786.3 Procedure: Name of Cataloged Procedure 826.4 Keyword Parameters 836.5 Region Size 836.6 COND: Conditions for Bypassing Job Steps 856.7 IF/THEN/ELSE/ENDIF Statement Construct 926.8 PARM: Pass Parameters to Job Steps 976.9 ACCT: Job Step Accounting Information 99

    6.10 SYSUDUMP, SYSABEND, SYSMDUMP: Abnormal Termination Dumps 100Exercises 101

    Chapter 7 The DD Statement 1037.1 Overview of Data Sets 1037.2 Data Control Block 1057.3 DD Statement Format 1067.4 ddname: Data Definition Name 1097.5 Referback: Referback Parameter 1097.6 DCB: Data Control Block Parameter 1107.7 DSN: Data Set Name 1207.8 DISP: Data Set Disposition 1257.9 UNIT: I/O Unit 135

    iv CONTENTS

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page iv

  • 7.10 VOL: Volume Parameter 140Exercises 145

    Chapter 8 More on the DD Statement 1468.1 Sequential and Partitioned Data Sets 1468.2 DUMMY, NULLFILE: Dummy Data Sets 1478.3 Concatenating Data Sets 149

    Exercises 152

    Chapter 9 DD Statements for Input Stream and Print Data Sets 153

    9.1 *,DATA: Input Stream Data Sets 1539.2 SYSOUT: Output Stream Data Sets 1559.3 The OUTPUT JCL Statement and Output DD Parameter 1589.4 The JES /*OUTPUT Statement 1689.5 The JES3 //*FORMAT PR Statement 1699.6 Parameters Coded on Several Statements 170

    Chapter 10 Direct-Access Storage Devices 18110.1 Direct-Access Hardware Devices 18110.2 Space Allocation 18310.3 The SPACE Parameter 18510.4 DCB Parameters 19410.5 Virtual I/O (VIO) Temporary Data Sets 19510.6 Estimating Space 19610.7 The LABEL Parameter: Data Set Labels 20010.8 Multivolume Data Sets 20010.9 Using Data Sets on Direct-Access Volumes 201

    10.10 ABSTR: Requesting Specific Tracks 205Exercises 206

    Chapter 11 SMS: Storage Management Subsystem 20811.1 The AVGREC Parameter 20911.2 The DATACLAS, STORCLAS, MGMTCLAS,

    and SECMODEL Parameters 20911.3 The LIKE and REFDD Parameters 21311.4 RECORG and KEYOFF for VSAM Data Sets 21411.5 DSNTYPE Parameter for Partitioned and Extended

    Sequential Data Sets 215

    CONTENTS v

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page v

  • Chapter 12 Magnetic Tapes 21712.1 Description of Tape 21712.2 LABEL: Tape Labels 22012.3 DCB Subparameters 22812.4 Using Tapes 22812.5 Compressing Data on Tape 23112.6 Multivolume Tape Data Sets 23212.7 Reading Tapes from Another Installation 23312.8 ISO/ANSI/FIPS Version 3 Labels 233

    Exercises 235

    Chapter 13 JES2 and JES3 23613.1 Job Entry Subsystems 23613.2 JES2 23613.3 JES3 239

    Chapter 14 Cataloged and Instream Procedures 24814.1 Modifying Statements in Cataloged Procedures 24914.2 Cataloged Procedures 25514.3 Instream Procedures 25714.4 Symbolic Parameters 25814.5 Nesting Procedures and the INCLUDE Statement 26714.6 DDNAME: Postponing Definition of Data Sets 27014.7 Example of Cataloged Procedure 272

    Exercises 274

    Chapter 15 Generation Data Groups 27615.1 Creating the Generation Data Group Base Entry 27615.2 Creating the Model Data Set Label

    (Non-SMS-Managed Data Sets Only) 27715.3 Creating a Generation Data Set 27815.4 Retrieving Generation Data Sets 28015.5 Listing Generation Data Group Catalog Information 28015.6 Deleting Generation Data Groups 280

    Chapter 16 Miscellaneous JCL Features 28216.1 Checkpoint/Restart 28216.2 Spanned Records 28916.3 Data Set Protection 28916.4 Job Execution Priority 29216.5 Other JCL Parameters 293

    vi CONTENTS

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page vi

  • 16.6 Null Statement 29616.7 Operator Commands 29716.8 CNTL/ENDCNTL Program Control Statements 29816.9 XMIT Data Transmission Statements 298

    Chapter 17 VSAM Data Sets 30017.1 Creating VSAM Data Sets with JCL 30417.2 Accessing VSAM Data Sets through JCL 30517.3 The IDCAMS Utility 30717.4 JOBCAT and STEPCAT DD Statements 314

    Chapter 18 The Linkage Editor and Loader 31518.1 The Linkage Editor 31518.2 The Loader 328

    Exercises 329

    Chapter 19 IBM Utility Programs 33119.1 The IDCAMS Utility 33119.2 The Icetool Utility Programs 33619.3 The IBM Utility Programs 341

    Chapter 20 Sort/Merge 35220.1 Sorting Concepts 35220.2 The DFSORT Program 35320.3 The SORT Statement 35420.4 MERGE Statement 35820.5 Other SORT Statements 35920.6 Sort Efficiency 376

    Exercises 378

    Chapter 21 ISPF 37921.1 Using ISPF 37921.2 Using ISPF for Programming 38421.3 Editing Data Sets 38821.4 Browsing Text 40821.5 The ISPF Utilities 409

    Chapter 22 TSO/E 41722.1 The TSO/E Language 41722.2 Logging on and off TSO/E 419

    CONTENTS vii

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page vii

  • 22.3 Displaying Information about Data Sets 42022.4 Allocating Data Sets 42222.5 Calling Programs 42422.6 Submitting Jobs 42422.7 Use of TSO/E for Utility Functions 42722.8 TSO/E CLISTs 428

    Chapter 23 TSO/E REXX 43823.1 Variables 43923.2 Arithmetic Expressions 44023.3 Logical Expressions 44023.4 Character Operations 44123.5 REXX Statements 44223.6 Supplying Arguments in the Command Line 447

    Chapter 24 Hierarchical File System (HFS) Files 44924.1 JCL Parameters for HFS Files 44924.2 TSO/E HFS Parameters 45324.3 The BPXBATCH Utility 453

    Chapter 25 JCL and the Internet 45625.1 Useful Web Sites 45625.2 Sending E-Mail from Batch Jobs 457

    Index 461

    viii CONTENTS

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page viii

  • PREFACE

    The IBM mainframe continues to be alive and well, despite all the attentionreceived by PCs. It has adapted to the changing environment, where issuessuch as security and reliability make it an ideal platform for the electroniceconomy. JCL (Job Control Language) is necessary to run batch jobs on IBMlarge mainframe computers, and batch jobs are an inherent part of pro-gramming on the mainframes. z/OS is the next generation of the OS/390operating system. The information for it in this book has been extractedfrom close to 40 IBM manuals. There are so many manuals for z/OS that ifprogrammers were each to have a personal copy of all the manuals theymight need, they would risk crushing the continental plate under theirweight. Since manuals are expensive, this book saves you and your com-pany money.

    This is the fifth edition of the JCL book. I have updated it to incorporaterecent changes to JCL and the z/OS features.

    My goal for this book continues to be to explain the operating systemand provide readers with most of the information they need to use it. Forthis reason, chapters on such subjects as the linkage editor, the IBM utili-ties, the Sort/Merge utility, VSAM, TSO/E, ISPF, and REXX are included.

    Please visit the books Web site at www.wiley.com/compbooks/brownfor solutions to the exercises and a summary of obsolete JCL features.

    Gary DeWard BrownLos Angeles, CaliforniaApril 2002

    ix

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page ix

  • 9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page x

  • Subparam-Parameter eter of Page

    ACCODE DD 234ACCT EXEC 101ADDRESS OUTPUT 168ADDRSPC JOB, EXEC 293AFF UNIT 140AMP DD 303AVGREC DD 209BLKSIZE DD, DCB 118BLKSZLIM DD TKBUFND AMP 304BUFNI AMP 304BUFNO DD, DCB 120BUFSP AMP 304BUILDING OUTPUT 168BURST DD, OUTPUT 175BYTES JOB 173CCSID JOB, EXEC TKCHARS DD, OUTPUT 176CHKPT DD 283CKPTLINE OUTPUT 174CKPTPAGE OUTPUT 174CKPTSEC OUTPUT 174CLASS JOB 66CLASS OUTPUT 166CNTL 296CNTL DD 296COLORMAP OUTPUT TKCOMMAND 295

    Subparam-Parameter eter of Page

    COMPACT OUTPUT 178COMSETUP OUTPUT 167COND JOB, EXEC 87CONTROL OUTPUT 178COPIES DD, OUTPUT 171CROPS AMP 304DATA DD 155DATACK OUTPUT 167DATACLAS DD 209DCB DD 112DD 105DDNAME DD 270DEFAULT OUTPUT 161DEN DD, DCB 228DEPT OUTPUT 168DEST DD, OUTPUT 173DISP DD 127DLM DD 156DPAGELBL OUTPUT 167DSN DD 122DSNTYPE DD 215DSORG DD, DCB 113DUMMY DD 149DUPLEX OUTPUT TKDYNAMNBR EXEC 294ENDCNTL 296EXEC 79EXPDT DD, LABEL 289

    xi

    JOB CONTROL LANGUAGEPARAMETERS

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page xi

  • Subparam-Parameter eter of Page

    FCB DD, OUTPUT 175FILEDATA DD 440FLASH DD, OUTPUT 177FORMDEF OUTPUT 167FORMLEN OUTPUT TKFORMS OUTPUT 175FREE DD 160GROUP JOB 291GROUPID OUTPUT 167HOLD DD 158IF/THEN/ELSE/ENDIF 94

    INCLUDE DD 268INDEX OUTPUT 179JCLLIB 257JESDS OUTPUT 166JOB 62JOBCAT Special DD 311JOBLIB Special DD 81KEYOFF DD 302LABEL DD 220LGSTREAM DD TKLIKE DD 213LINDEX OUTPUT 179LINECT OUTPUT 178LINES JOB 172LRECL DD, DCB 116MEMLIMIT JOB, EXEC TKMGMTCLAS DD 211MODIFY DD, OUTPUT 176MSGCLASS JOB 69MSGLEVEL JOB 74NAME OUTPUT 168NOTIFY JOB 415NOTIFY OUTPUT 166NULLFILE DSN 149OFFSET OUTPUT TKOPTCD DD, DCB, AMP 176OUTBIN OUTPUT 166OUTDISP OUTPUT 166OUTLIM DD 172

    Subparam-Parameter eter of Page

    OUTPUT 160OUTPUT DD 160OVERLAY OUTPUT TKOVFL OUTPUT 179PAGEDEF OUTPUT 167PAGES JOB 173PARM EXEC 99PASSWORD JOB 291PATH DD 439PATHDISP DD 440PATHMODE DD 442PATHOPTS DD 440PEND 257PERFORM JOB, EXEC 293PGM EXEC 80PIMSG OUTPUT 167PRMODE OUTPUT 167PROC 255PROC EXEC 85PROTECT DD 291PRTERROR OUTPUT TKPRTNO OUTPUT TKPRTOPTNS OUTPUT TKPRTQUEUE OUTPUT TKPRTSP DD, DCB 178PRTY JOB 292PRTY OUTPUT 167QNAME DD 294RD JOB, EXEC 284RECFM DD, DCB 114RECORG DD 302REF VOL 143REFDD DD 213REGION JOB, EXEC 85RESFMT OUTPUT TKRESTART JOB 285RETAIN OUTPUT TKRETRY OUTPUT TKRETPD DD, LABEL 289RLS DD 304ROOM OUTPUT 168

    xii JOB CONTROL LANGUAGE PARAMETERS

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page xii

  • Subparam-Parameter eter of Page

    SCHENV JOB TKSECLABEL JOB 291SECMODEL DD 212SEGMENT DD 159SER VOL 143SET 263SORTCKPT Special DD 283SPIN DD 159SPACE DD 185STEPCAT Special DD 311STEPLIB Special DD 82STORCLAS DD 209STRNO AMP 304SUBSYS DD 295SYNAD AMP 304SYMNAMES DD TKSYSABEND Special DD 102SYSAREA OUTPUT 168SYSCHK Special DD 287SYSCKEOV Special DD 283SYSIN Special DD 155SYSMDUMP Special DD 103

    Subparam-Parameter eter of Page

    SYSOUT DD 157SYSUDUMP Special DD 102TERM DD 417THRESHLD OUTPUT 179TIME JOB, EXEC 67TITLE OUTPUT 168TRC OUTPUT 176TRTCH DD, DCB 105TYPRUN JOB 75UNIT DD 137USER JOB 291USERDATA OUTPUT 168USERLIB OUTPUT 168VIO DD 195VOL DD 142WRITER OUTPUT 174XMIT 297//* 58// 295/* 155* DD 155

    JOB CONTROL LANGUAGE PARAMETERS xiii

    9228 Brown/JCL FM.k.qxd 5/2/02 11:36 AM Page xiii