version 2 release 3 z/os · chapter 4. backing up and recovering data sets.....47 using repro for...

680
z/OS Version 2 Release 3 DFSMS Using Data Sets IBM SC23-6855-30

Upload: others

Post on 17-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

  • z/OSVersion 2 Release 3

    DFSMS Using Data Sets

    IBM

    SC23-6855-30

  • Note

    Before using this information and the product it supports, read the information in “Notices” on page583.

    This edition applies to Version 2 Release 3 of z/OS (5650-ZOS) and to all subsequent releases and modifications untilotherwise indicated in new editions.

    Last updated: 2019-06-24© Copyright International Business Machines Corporation 1987, 2018.US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract withIBM Corp.

  • Contents

    Figures............................................................................................................... xix

    Tables................................................................................................................xxv

    About This Document........................................................................................ xxixMajor Divisions of This Document........................................................................................................... xxixRequired product knowledge.................................................................................................................. xxixReferenced documents............................................................................................................................ xxxz/OS information.......................................................................................................................................xxx

    How to send your comments to IBM................................................................... xxxiIf you have a technical problem.............................................................................................................. xxxi

    Summary of changes....................................................................................... xxxiiiSummary of changes for z/OS V2R3..................................................................................................... xxxiiiSummary of changes for z/OS V2R2..................................................................................................... xxxiiiSummary of changes for z/OS V2R1, as updated March 2014............................................................ xxxivSummary of changes for z/OS Version 2 Release 1 (V2R1) as updated December 2013...................xxxiv

    Part 1. All Data Sets...............................................................................................1

    Chapter 1. Working with Data Sets..............................................................................................................3Data Storage and Management..............................................................................................................3

    System-Managed Data Sets..............................................................................................................4Distributed File Manager...................................................................................................................4

    Access Methods......................................................................................................................................4Basic Direct Access Method............................................................................................................. 4Basic Partitioned Access Method..................................................................................................... 4Basic Sequential Access Method......................................................................................................5Data-in-Virtual (DIV)......................................................................................................................... 5Indexed Sequential Access Method................................................................................................. 5Object Access Method...................................................................................................................... 5Queued Sequential Access Method..................................................................................................6Virtual Storage Access Method.........................................................................................................6Access to z/OS UNIX Files................................................................................................................ 7Selection of an Access Method.........................................................................................................7

    Direct Access Storage Device (DASD) Volumes.....................................................................................8DASD Labels...................................................................................................................................... 8Track Format..................................................................................................................................... 8Track Overflow.................................................................................................................................. 9VSAM Record Addressing................................................................................................................. 9Actual and Relative Addressing with Non-VSAM Access Methods..................................................9

    Magnetic Tape Volumes....................................................................................................................... 11Using Magnetic Tape Labels........................................................................................................... 11Specifying the File Sequence Number........................................................................................... 11Identifying Unlabeled Tapes...........................................................................................................13Using Tape Marks............................................................................................................................13

    Data Management Macros................................................................................................................... 14Data Set Processing..............................................................................................................................14

    iii

  • Allocating Data Sets........................................................................................................................14Processing Data Sets through Programs........................................................................................15Using Access Methods....................................................................................................................16Using Addressing Modes................................................................................................................ 16Using Hiperspace and Hiperbatch..................................................................................................17Processing VSAM Data Sets............................................................................................................17Processing PDSs, PDSEs, and UNIX Directories............................................................................ 17Processing Sequential Data Sets and Members of PDSEs and PDSs............................................ 18Processing UNIX Files with an Access Method..............................................................................19Processing EXCP, EXCPVR, and XDAP Macros............................................................................... 19Processing data sets on read-only devices....................................................................................20

    Distributed Data Management (DDM) Attributes................................................................................ 23Virtual I/O for Temporary Data Sets.................................................................................................... 23Data Set Names....................................................................................................................................24Catalogs and Volume Table of Contents..............................................................................................25

    VTOC................................................................................................................................................25Catalogs...........................................................................................................................................25Data Set Names and Metadata.......................................................................................................25Security of Data Set Names............................................................................................................26

    Chapter 2. Using the Storage Management Subsystem........................................................................... 27Using Automatic Class Selection Routines..........................................................................................29Allocating Data Sets............................................................................................................................. 29

    Allocating Data Sets with JCL.........................................................................................................30Allocating System-Managed Data Sets with the Access Method Services ALLOCATE

    Command...................................................................................................................................31Allocating Data Sets with the TSO ALLOCATE Command..............................................................33Allocating Data Sets with Dynamic Allocation............................................................................... 33

    Chapter 3. Allocating Space on Direct Access Volumes........................................................................... 35Specification of Space Requirements..................................................................................................35

    Blocks..............................................................................................................................................35Average Record Length...................................................................................................................36Tracks or Cylinders......................................................................................................................... 36Absolute Track................................................................................................................................ 37Additional Space-Allocation Options............................................................................................. 37

    Maximum Data Set Size........................................................................................................................37Maximum Size on One Volume....................................................................................................... 37Maximum Number of Volumes....................................................................................................... 37Maximum VSAM Data Set Size........................................................................................................37

    Minimum data set size......................................................................................................................... 38Primary and Secondary Space Allocation without the Guaranteed Space Attribute......................... 38

    Multivolume VSAM Data Sets......................................................................................................... 39Multivolume Non-VSAM Data Sets................................................................................................. 39Extended-Format Data Sets........................................................................................................... 39

    Allocation of Data Sets with the Guaranteed Space Attribute............................................................ 40Guaranteed Space with DISP=NEW or MOD..................................................................................40Guaranteed Space for VSAM.......................................................................................................... 40Guaranteed Space with DISP=OLD or SHR....................................................................................40Guaranteed Space with Extended-Format Data Sets.................................................................... 41Guaranteed Space Example........................................................................................................... 41

    Allocation of Data Sets with the Space Constraint Relief Attributes.................................................. 41Examples of Dynamic Volume Count When Defining a Data Set...................................................42Examples of Dynamic Volume Count When Allocating an Existing Data Set................................ 42

    Extension to Another DASD Volume.................................................................................................... 43Multiple Volume Considerations for Sequential Data Sets................................................................. 43Extended Address Volumes................................................................................................................. 44Additional Information on Space Allocation........................................................................................46

    iv

  • Chapter 4. Backing Up and Recovering Data Sets.................................................................................... 47Using REPRO for Backup and Recovery...............................................................................................47Using EXPORT and IMPORT for Backup and Recovery of VSAM Data Sets........................................ 49

    Structure of an Exported Data Set..................................................................................................49EXPORT and IMPORT Commands.................................................................................................. 49

    Writing a Program for Backup and Recovery....................................................................................... 50Using Concurrent Copy for Backup and Recovery...............................................................................50Updating a Data Set After Recovery.....................................................................................................50Synchronizing Catalog and VSAM Data Set Information During Recovery......................................... 51

    Handling an Abnormal Termination............................................................................................... 51Using VERIFY to Process Improperly Closed Data Sets................................................................ 51

    CICS® VSAM Recovery.......................................................................................................................... 53

    Chapter 5. Protecting Data Sets................................................................................................................ 55z/OS Security Server (RACF)................................................................................................................ 55

    RACF Protection for VSAM Data Sets............................................................................................. 55Generic and Discrete Profiles for VSAM Data Sets........................................................................ 55RACF Protection for Non-VSAM Data Sets..................................................................................... 56Hiding Data Set Names...................................................................................................................57

    Data Set Encryption..............................................................................................................................57Data Set Password Protection..............................................................................................................65

    Assigning a Password..................................................................................................................... 65Protecting a Data Set When You Define It......................................................................................65Handling Incorrect Passwords....................................................................................................... 66Entering a Record in the PASSWORD Data Set.............................................................................. 66

    User-Security-Verification Routine...................................................................................................... 66Erasure of Residual Data......................................................................................................................66

    Erasing DASD Data..........................................................................................................................66Erasing Tape Data........................................................................................................................... 67

    Authorized Program Facility and Access Method Services................................................................. 68Access Method Services Cryptographic Option...................................................................................69

    Data Enciphering and Deciphering................................................................................................. 69REPRO ENCIPHER and DECIPHER on ICSF................................................................................... 71

    Part 2. VSAM Access to Data Sets and UNIX Files................................................. 73

    Chapter 6. Organizing VSAM Data Sets..................................................................................................... 75VSAM Data Formats..............................................................................................................................75

    Data Set Size................................................................................................................................... 75Control Intervals............................................................................................................................. 76Control Information Fields............................................................................................................. 76Compressed Control Information Field..........................................................................................77Control Areas.................................................................................................................................. 78Spanned Records............................................................................................................................78

    Selection of VSAM Data Set Types.......................................................................................................79Entry-Sequenced Data Sets............................................................................................................80Simulated VSAM Access to UNIX files........................................................................................... 81Key-Sequenced Data Sets.............................................................................................................. 83Linear Data Sets.............................................................................................................................. 86Fixed-Length Relative-Record Data Sets....................................................................................... 86Variable-Length Relative-Record Data Sets...................................................................................87Summary of VSAM Data Set Types.................................................................................................88

    Extended-Format VSAM Data Sets...................................................................................................... 89Restrictions on Defining Extended-Format Data Sets................................................................... 89VSAM Data Striping......................................................................................................................... 90Compressed Data............................................................................................................................94

    v

  • Access to Records in a VSAM Data Set................................................................................................ 94Access to Entry-Sequenced Data Sets........................................................................................... 95Access to Key-Sequenced Data Sets..............................................................................................95Access to Linear Data Sets............................................................................................................. 96Access to Fixed-Length Relative-Record Data Sets.......................................................................96Access to Variable-Length Relative-Record Data Sets.................................................................. 97

    Access to Records through Alternate Indexes.................................................................................... 97Alternate Index Structure for a Key-Sequenced Data Set.............................................................98Alternate Index Structure for an Entry-Sequenced Data Set........................................................ 98Building of an Alternate Index........................................................................................................99Automatic Upgrade of Alternate Indexes.................................................................................... 100

    Data Compression..............................................................................................................................100

    Chapter 7. Defining VSAM Data Sets.......................................................................................................101Using Cluster Names for Data and Index Components.................................................................... 101Defining a Data Set with Access Method Services............................................................................ 102

    Naming a Cluster.......................................................................................................................... 102Specifying Cluster Information.................................................................................................... 103Using Access Method Services Parameters.................................................................................104Allocating Space for VSAM Data Sets...........................................................................................105Calculating Space for the Data Component of a KSDS................................................................ 108Calculating Space for the Index Component............................................................................... 109Using ALTER to Modify Attributes of a Component..................................................................... 109Using ALTER to Rename Data Sets...............................................................................................109

    Defining a Data Set with JCL.............................................................................................................. 109Loading a VSAM Data Set................................................................................................................... 110

    Using REPRO to Copy a VSAM Data Set....................................................................................... 110Using a Program to Load a Data Set.............................................................................................111Reusing a VSAM Data Set as a Work File..................................................................................... 112

    Copying and Merging Data Sets......................................................................................................... 113Defining Alternate Indexes................................................................................................................ 114

    Naming an Alternate Index.......................................................................................................... 115Specifying Alternate Index Information...................................................................................... 115Building an Alternate Index..........................................................................................................116Maintaining Alternate Indexes..................................................................................................... 116Defining a Path..............................................................................................................................117

    Defining a Page Space........................................................................................................................117Checking for Problems in Catalogs and Data Sets............................................................................ 118

    Listing Catalog Entries.................................................................................................................. 118Printing the Contents of Data Sets............................................................................................... 119

    Deleting Data Sets..............................................................................................................................119

    Chapter 8. Defining and Manipulating VSAM Data Sets: Examples....................................................... 121Example of Defining a VSAM Data Set............................................................................................... 121Examples of Defining Temporary VSAM Data Sets............................................................................123

    Example 1: Defining a Temporary VSAM Data Set Using ALLOCATE...........................................123Example 2: Creating a Temporary Data Set with Default Parameter Values.............................. 124

    Examples of Defining Alternate Indexes and Paths..........................................................................124JCL Statements.............................................................................................................................124Commands....................................................................................................................................124

    Chapter 9. Processing VSAM Data Sets.................................................................................................. 127Creating an Access Method Control Block........................................................................................ 127Creating an Exit List............................................................................................................................128Opening a Data Set.............................................................................................................................129Creating a Request Parameter List.................................................................................................... 130Manipulating the Contents of Control Blocks....................................................................................131

    Generating a Control Block.......................................................................................................... 131

    vi

  • Testing the Contents of ACB, EXLST, and RPL Fields...................................................................131Modifying the Contents of an ACB, EXLST, or RPL....................................................................... 132Displaying the Contents of ACB, EXLST, and RPL Fields............................................................. 132

    Requesting Access to a Data Set....................................................................................................... 132Inserting and Adding Records......................................................................................................133Retrieving Records........................................................................................................................134Updating Records......................................................................................................................... 136Deleting Records...........................................................................................................................136Deferring and Forcing Buffer Writing........................................................................................... 137Retaining and Positioning Data Buffers....................................................................................... 137Processing Multiple Strings.......................................................................................................... 137Making Concurrent Requests....................................................................................................... 138Using a Path to Access Records................................................................................................... 139Making Asynchronous Requests.................................................................................................. 139Ending a Request.......................................................................................................................... 140

    Closing Data Sets............................................................................................................................... 140Operating in SRB or Cross-Memory Mode.........................................................................................141Using VSAM Macros in Programs....................................................................................................... 142

    Chapter 10. Optimizing VSAM Performance........................................................................................... 145Optimizing Control Interval Size........................................................................................................ 145

    Control Interval Size Limitations..................................................................................................145Data Control Interval Size............................................................................................................ 147Index Control Interval Size...........................................................................................................147How VSAM Adjusts Control Interval Size..................................................................................... 148

    Optimizing Control Area Size............................................................................................................. 148Advantages of a Large Control Area Size..................................................................................... 149Disadvantages of a Large Control Area Size.................................................................................149

    Optimizing Free Space Distribution................................................................................................... 149Selecting the Optimal Percentage of Free Space........................................................................ 150Altering the Free Space Specification When Loading a Data Set................................................ 151Reclaiming CA Space for a KSDS..................................................................................................151

    Determining I/O Buffer Space for Nonshared Resource...................................................................154Obtaining Buffers Above 16 MB................................................................................................... 155Tuning for System-Managed Buffering........................................................................................ 155Allocating Buffers for Concurrent Data Set Positioning...............................................................160Allocating Buffers for Direct Access.............................................................................................160Allocating Buffers for Sequential Access.....................................................................................163Allocating Buffers for a Path.........................................................................................................163Acquiring Buffers.......................................................................................................................... 164

    Using Index Options...........................................................................................................................164Increasing Virtual Storage for Index Set Records....................................................................... 165Avoiding Control Area Splits.........................................................................................................165Putting the Index and Data on Separate Volumes.......................................................................165

    Obtaining Diagnostic Information......................................................................................................165Migrating from the Mass Storage System..........................................................................................165Using Hiperbatch................................................................................................................................166

    Chapter 11. Processing Control Intervals...............................................................................................167Access to a Control Interval...............................................................................................................167Structure of Control Information....................................................................................................... 168

    CIDF—Control Interval Definition Field........................................................................................169RDF—Record Definition Field....................................................................................................... 169

    User Buffering.................................................................................................................................... 173Improved Control Interval Access.....................................................................................................173

    Opening an Object for Improved Control Interval Access...........................................................173Processing a Data Set with Improved Control Interval Access...................................................174Fixing Control Blocks and Buffers in Real Storage...................................................................... 174

    vii

  • Control Blocks in Common (CBIC) Option.........................................................................................174

    Chapter 12. Sharing VSAM Data Sets......................................................................................................177Subtask Sharing................................................................................................................................. 178

    Building a Single Control Block Structure....................................................................................178Resolving Exclusive Control Conflicts.......................................................................................... 178Preventing Deadlock in Exclusive Control of Shared Resources.................................................181

    Cross-Region Sharing.........................................................................................................................183Cross-Region Share Options........................................................................................................ 183Read Integrity During Cross-Region Sharing............................................................................... 184Write Integrity During Cross-Region Sharing...............................................................................185

    Cross-System Sharing........................................................................................................................ 185Control Block Update Facility (CBUF)................................................................................................186

    Considerations for CBUF Processing............................................................................................187Checkpoints for Shared Data Sets................................................................................................188

    Techniques of Data Sharing............................................................................................................... 188Cross-Region Sharing................................................................................................................... 188Cross-System Sharing.................................................................................................................. 189User Access to VSAM Shared Information...................................................................................190

    Chapter 13. Sharing Resources Among VSAM Data Sets....................................................................... 191Provision of a Resource Pool..............................................................................................................191

    Building a Resource Pool: BLDVRP.............................................................................................. 191Connecting a Data Set to a Resource Pool: OPEN....................................................................... 194Deleting a Resource Pool Using the DLVRP Macro...................................................................... 194

    Management of I/O Buffers for Shared Resources........................................................................... 195Deferring Write Requests............................................................................................................. 195Relating Deferred Requests by Transaction ID............................................................................196Writing Buffers Whose Writing is Deferred: WRTBFR..................................................................196Accessing a Control Interval with Shared Resources..................................................................197

    Restrictions and Guidelines for Shared Resources........................................................................... 198

    Chapter 14. Using VSAM Record-Level Sharing......................................................................................201Controlling Access to VSAM Data Sets.............................................................................................. 201Accessing Data Sets Using DFSMStvs and VSAM Record-Level Sharing..........................................201

    Record-Level Sharing CF Caching................................................................................................ 202VSAM Record-Level Sharing Multiple Lock Structure..................................................................203Using VSAM RLS with CICS...........................................................................................................203Non-CICS Use of VSAM RLS......................................................................................................... 205Using 64-Bit Addressable Data Buffers....................................................................................... 206Read Sharing of Recoverable Data Sets.......................................................................................207Read-Sharing Integrity across KSDS CI and CA Splits................................................................ 207Read and Write Sharing of Nonrecoverable Data Sets................................................................ 207Using Non-RLS Access to VSAM Data Sets.................................................................................. 208RLS Access Rules..........................................................................................................................208Comparing RLS Access and Non-RLS Access.............................................................................. 209Requesting VSAM RLS Run-Mode................................................................................................ 211Using VSAM RLS Read Integrity Options......................................................................................211

    Using VSAM RLS with ESDS............................................................................................................... 212Specifying Read Integrity...................................................................................................................212Specifying a Timeout Value for Lock Requests................................................................................. 213Index Trap.......................................................................................................................................... 213

    Chapter 15. Checking VSAM Key-Sequenced Data Set Clusters for Structural Errors.......................... 215EXAMINE Command.......................................................................................................................... 215

    Types of Data Sets........................................................................................................................ 215EXAMINE Users............................................................................................................................ 215

    How to Run EXAMINE........................................................................................................................ 216

    viii

  • Deciding to Run INDEXTEST, DATATEST, or Both Tests...............................................................216Skipping DATATEST on Major INDEXTEST Errors........................................................................ 216Examining a User Catalog.............................................................................................................216Understanding Message Hierarchy.............................................................................................. 216Controlling Message Printout....................................................................................................... 217

    Samples of Output from EXAMINE Runs...........................................................................................217INDEXTEST and DATATEST Tests of an Error-Free Data Set....................................................... 217INDEXTEST and DATATEST Tests of a Data Set with a Structural Error......................................218INDEXTEST and DATATEST Tests of a Data Set with a Duplicate Key Error................................219

    Chapter 16. Coding VSAM User-Written Exit Routines...........................................................................221Guidelines for Coding Exit Routines.................................................................................................. 221Programming Guidelines....................................................................................................................222

    Multiple Request Parameter Lists or Data Sets........................................................................... 222Return to a Main Program.............................................................................................................223

    IGW8PNRU Routine for Batch Override............................................................................................ 223Register Contents......................................................................................................................... 224Programming Considerations.......................................................................................................224

    EODAD Exit Routine to Process End of Data..................................................................................... 225Register Contents......................................................................................................................... 225Programming Considerations.......................................................................................................225

    EXCEPTIONEXIT Exit Routine............................................................................................................226Register Contents......................................................................................................................... 226Programming Considerations.......................................................................................................226

    JRNAD Exit Routine to Journalize Transactions................................................................................226Register Contents......................................................................................................................... 227Programming Considerations.......................................................................................................227

    LERAD Exit Routine to Analyze Logical Errors................................................................................... 235Register Contents......................................................................................................................... 235Programming Considerations.......................................................................................................235

    RLSWAIT Exit Routine........................................................................................................................236Register Contents......................................................................................................................... 236Request Environment................................................................................................................... 236

    SYNAD Exit Routine to Analyze Physical Errors................................................................................ 237Register Contents......................................................................................................................... 237Programming Considerations.......................................................................................................237Example of a SYNAD User-Written Exit Routine.......................................................................... 238

    UPAD Exit Routine for User Processing............................................................................................. 239Register Contents......................................................................................................................... 240Programming Considerations.......................................................................................................240

    User-Security-Verification Routine.................................................................................................... 241

    Chapter 17. Using 31-Bit Addressing Mode with VSAM.........................................................................243VSAM Options.....................................................................................................................................243

    Chapter 18. Using Job Control Language for VSAM................................................................................245Using JCL Statements and Keywords................................................................................................ 245

    Data Set Name.............................................................................................................................. 245Disposition.................................................................................................................................... 245

    Creating VSAM Data Sets with JCL.................................................................................................... 245Temporary VSAM Data Sets..........................................................................................................247Examples Using JCL to Allocate VSAM Data Sets........................................................................248

    Retrieving an Existing VSAM Data Set............................................................................................... 250Migration Consideration............................................................................................................... 250Keywords Used to Process VSAM Data Sets................................................................................250

    Chapter 19. Processing Indexes of Key-Sequenced Data Sets..............................................................253Access to a Key-Sequenced Data Set Index..................................................................................... 253

    ix

  • Access to an Index with GETIX and PUTIX..................................................................................253Access to the Index Component Alone........................................................................................253Prime Index...................................................................................................................................254Index Levels..................................................................................................................................255VSAM index trap........................................................................................................................... 255

    Format of an Index Record................................................................................................................ 256Header Portion..............................................................................................................................256Free Control Interval Entry Portion.............................................................................................. 258Index Entry Portion.......................................................................................................................258

    Key Compression................................................................................................................................259Index Update Following a Control Interval Split..........................................................................261Index Entries for a Spanned Record............................................................................................ 262

    Part 3. Non-VSAM Access to Data Sets and UNIX Files........................................ 263

    Chapter 20. Selecting Record Formats for Non-VSAM Data Sets.......................................................... 265Format Selection................................................................................................................................ 265Fixed-Length Record Formats........................................................................................................... 266

    Standard Format...........................................................................................................................266Restrictions................................................................................................................................... 267

    Variable-Length Record Formats.......................................................................................................267Format-V Records.........................................................................................................................267Spanned Format-VS Records (Sequential Access Method).........................................................269Spanned Format-V Records (Basic Direct Access Method).........................................................272

    Undefined-Length Record Format..................................................................................................... 273ISO/ANSI Tapes..................................................................................................................................273

    Character Data Conversion...........................................................................................................273Format-F Records......................................................................................................................... 274Format-D Records.........................................................................................................................275ISO/ANSI Format-DS and Format-DBS Records......................................................................... 277Format-U Records.........................................................................................................................280

    Record Format—Device Type Considerations....................................................................................280Using Optional Control Characters...............................................................................................280Using Direct Access Storage Devices (DASD).............................................................................. 281Using Magnetic Tape.....................................................................................................................281Using a Printer.............................................................................................................................. 282Using a Card Reader and Punch................................................................................................... 283Using a Paper Tape Reader...........................................................................................................284

    Chapter 21. Specifying and Initializing Data Control Blocks..................................................................285Processing Sequential and Partitioned Data Sets.............................................................................286Using OPEN to Prepare a Data Set for Processing............................................................................ 289

    Filling in the DCB...........................................................................................................................290Specifying the Forms of Macros, Buffering Requirements, and Addresses................................291Coding Processing Methods......................................................................................................... 292

    Selecting Data Set Options................................................................................................................ 292Block Size (BLKSIZE).................................................................................................................... 293Data Set Organization (DSORG)....................................................................................................297Key Length (KEYLEN)....................................................................................................................297Record Length (LRECL)................................................................................................................. 298Record Format (RECFM)............................................................................................................... 298Write Validity Check Option (OPTCD=W)..................................................................................... 298DD Statement Parameters............................................................................................................298

    Changing and Testing the DCB and DCBE..........................................................................................299Using the DCBD Macro..................................................................................................................300Changing an Address in the DCB..................................................................................................300Using the IHADCBE Macro........................................................................................................... 300

    x

  • Using CLOSE to End the Processing of a Data Set.............................................................................301Issuing the CHECK Macro.............................................................................................................301Closing a Data Set Temporarily.................................................................................................... 301Using CLOSE TYPE=T with Sequential Data Sets.........................................................................302Releasing Space............................................................................................................................302Managing Buffer Pools When Closing Data Sets..........................................................................303

    Opening and Closing Data Sets: Considerations............................................................................... 303Parameter Lists with 31-Bit Addresses....................................................................................... 303Open and Close of Multiple Data Sets at the Same Time............................................................ 303Factors to Consider When Allocating Direct Access Data Sets................................................... 304Using Access Methods in System Key Programs......................................................................... 304Guidelines for Opening and Closing Data Sets............................................................................ 304Open/Close/EOV Errors................................................................................................................ 304Installation Exits...........................................................................................................................305

    Positioning Volumes...........................................................................................................................305Releasing Data Sets and Volumes................................................................................................306Processing End-of-Volume...........................................................................................................306Positioning During End-of-Volume...............................................................................................307Forcing End-of-Volume.................................................................................................................308

    Managing SAM Buffer Space..............................................................................................................308Constructing a Buffer Pool................................................................................................................. 309

    Building a Buffer Pool................................................................................................................... 310Building a Buffer Pool and a Record Area.................................................................................... 310Getting a Buffer Pool.................................................................................................................... 310Constructing a Buffer Pool Automatically....................................................................................310Freeing a Buffer Pool.................................................................................................................... 311Constructing a Buffer Pool: Examples......................................................................................... 311

    Controlling Buffers............................................................................................................................. 312Queued Access Method................................................................................................................312Basic Access Method....................................................................................................................313QSAM in an Application................................................................................................................ 313Exchange Buffering.......................................................................................................................315

    Choosing Buffering Techniques and GET/PUT Processing Modes....................................................315Using Buffering Macros with Queued Access Method...................................................................... 315

    RELSE—Release an Input Buffer.................................................................................................. 315TRUNC—Truncate an Output Buffer............................................................................................. 316

    Using Buffering Macros with Basic Access Method.......................................................................... 316GETBUF—Get a Buffer from a Pool...............................................................................................316FREEBUF—Return a Buffer to a Pool............................................................................................316

    Chapter 22. Accessing Records...............................................................................................................317Accessing Data with READ and WRITE..............................................................................................317

    Using the Data Event Control Block (DECB).................................................................................317Grouping Related Control Blocks in a Paging Environment.........................................................317Using Overlapped I/O with BSAM................................................................................................ 317Reading a Block............................................................................................................................ 318Writing a Block..............................................................................................................................319Ensuring I/O Initiation with the TRUNC Macro............................................................................ 320Testing Completion of a Read or Write Operation....................................................................... 320Waiting for Completion of a Read or Write Operation................................................................. 320Handling Exceptional Conditions on Tape................................................................................... 321

    Accessing Data with GET and PUT.....................................................................................................321GET—Retrieve a Record................................................................................................................ 322PUT—Write a Record..................................................................................................................... 322PUTX—Write an Updated Record..................................................................................................322PDAB—Parallel Input Processing (QSAM Only)........................................................................... 322

    Analyzing I/O Errors........................................................................................................................... 324SYNADAF—Perform SYNAD Analysis Function............................................................................ 325

    xi

  • SYNADRLS—Release SYNADAF Message and Save Areas.......................................................... 325Device Support Facilities (ICKDSF): Diagnosing I/O Problems...................................................326

    Limitations with Using SRB or Cross-Memory Mode.........................................................................326Using BSAM, BPAM, and QSAM support for XTIOT, uncaptured UCBs, and DSAB above the 16

    MB line...........................................................................................................................................326Planning to use BSAM, BPAM, QSAM and OCE support for XTIOT, uncaptured UCBs, and

    DSAB above the line................................................................................................................ 326Adapting applications for BSAM, BPAM, QSAM and OCE support for XTIOT, uncaptured

    UCBs, and DSAB above the line.............................................................................................. 327Coding the LOC=ANY DCBE option...............................................................................................331Coding the DEVSUPxx option....................................................................................................... 331Diagnosing problems with BSAM, BPAM, QSAM and OCE support for XTIOT, uncaptured

    UCBs, and DSAB above the line.............................................................................................. 332

    Chapter 23. Sharing Non-VSAM Data Sets..............................................................................................333Enhanced Data Integrity for Shared Sequential Data Sets............................................................... 336

    Setting Up the Enhanced Data Integrity Function....................................................................... 336Synchronizing the Enhanced Data Integrity Function on Multiple Systems............................... 337Using the START IFGEDI Command.............................................................................................337Bypassing the Enhanced Data Integrity Function for Applications.............................................338Diagnosing Data Integrity Warnings and Violations.................................................................... 338

    PDSEs................................................................................................................................................. 340Direct Data Sets (BDAM).................................................................................................................... 340Factors to Consider When Opening and Closing Data Sets...............................................................340Control of Checkpoint Data Sets on Shared DASD Volumes.............................................................341System Use of Search Direct for Input Operations........................................................................... 342

    Chapter 24. Spooling and Scheduling Data Sets.................................................................................... 343Job Entry Subsystem......................................................................................................................... 343SYSIN Data Set...................................................................................................................................343SYSOUT Data Set................................................................................................................................344

    Chapter 25. Processing Sequential Data Sets........................................................................................ 345Creating a Sequential Data Set.......................................................................................................... 345

    Types of DASD Sequential Data Sets........................................................................................... 346Retrieving a Sequential Data Set....................................................................................................... 346Concatenating Data Sets Sequentially.............................................................................................. 347

    Concatenating Like Data Sets.......................................................................................................348Concatenating Unlike Data Sets...................................................................................................352

    Modifying Sequential Data Sets.........................................................................................................353Updating in Place..........................................................................................................................353Using Overlapped Operations...................................................................................................... 354Extending a Data Set.................................................................................................................... 354

    Achieving Device Independence....................................................................................................... 354Device-Dependent Macros........................................................................................................... 355DCB and DCBE Subparameters.................................................................................................... 355

    Improving Performance for Sequential Data Sets............................................................................ 356Limitations on Using Chained Scheduling with Non-DASD Data Sets.........................................356DASD and Tape Performance....................................................................................................... 357

    Determining the Length of a Block when Reading with BSAM, BPAM, or BDAM..............................359Writing a Short Format-FB Block with BSAM or BPAM..................................................................... 360Using Hiperbatch................................................................................................................................361Processing Extended-Format Sequential Data Sets......................................................................... 361

    Characteristics of Extended-Format Data Sets........................................................................... 361Allocating Extended-Format Data Sets........................................................................................362Allocating Compressed-Format Data Sets...................................................................................363Opening and Closing Extended-Format Data Sets...................................................................... 365Reading, Writing, and Updating Extended-Format Data Sets Using BSAM and QSAM.............. 365

    xii

  • Concatenating Extended-Format Data Sets with Other Data Sets............................................. 365Extending Striped Sequential Data Sets...................................................................................... 365Migrating to Extended-Format Data Sets.....................................................................................366

    Processing Large Format Data Sets................................................................................................... 367Characteristics of Large Format Data Sets...................................................................................367Allocating Large Format Data Sets...............................................................................................367Opening and Closing Large Format Data Sets..............................................................................368Migrating to Large Format Data Sets............................................................................................368

    Chapter 26. Processing a Partitioned Data Set (PDS).............................................................................371Structure of a PDS.............................................................................................................................. 371PDS Directory..................................................................................................................................... 372Allocating Space for a PDS.................................................................................................................374

    Calculating Space......................................................................................................................... 374Allocating Space with SPACE and AVGREC..................................................................................375

    Creating a PDS....................................................................................................................................375Creating a PDS Member with BSAM or QSAM..............................................................................375Converting PDSs........................................................................................................................... 376Copying a PDS or Member to Another Data Set...........................................................................377Adding Members...........................................................................................................................377

    Processing a Member of a PDS.......................................................................................................... 378BLDL—Construct a Directory Entry List........................................................................................ 378DESERV......................................................................................................................................... 379FIND—Position to the Starting Address of a Member..................................................................382STOW—Update the Directory....................................................................................................... 382

    Retrieving a Member of a PDS........................................................................................................... 383Modifying a PDS................................................................................................................................. 387

    Updating in Place..........................................................................................................................387Rewriting a Member......................................................................................................................388

    Concatenating PDSs...........................................................................................................................389Sequential Concatenation............................................................................................................ 389Partitioned Concatenation............................................................................................................389

    Reading a PDS Directory Sequentially...............................................................................................389

    Chapter 27. Processing a Partitioned Data Set Extended (PDSE)..........................................................391Advantages of PDSEs......................................................................................................................... 391

    PDSE and PDS Similarities............................................................................................................392PDSE and PDS Differences........................................................................................................... 392

    Structure of a PDSE............................................................................................................................393PDSE Logical Block Size............................................................................................................... 394Reuse of Space............................................................................................................................. 394Directory Structure....................................................................................................................... 394Relative Track Addresses (TTR)................................................................................................... 394

    Processing PDSE Records.................................................................................................................. 396PDSE member size limits..............................................................................................................396Using BLKSIZE with PDSEs.......................................................................................................... 397Using KEYLEN with PDSEs............................................................................................................397Reblocking PDSE Records............................................................................................................ 397Processing Short Blocks............................................................................................................... 398Processing SAM Null Segments................................................................................................... 398

    Allocating Space for a PDSE...............................................................................................................398PDSE Space Considerations......................................................................................................... 399Summary of PDSE Storage Requirements................................................................................... 401

    Defining a PDSE..................................................................................................................................401PDSE version...................................................................................................................................... 402PDSE Member Generations................................................................................................................403Creating a PDSE Member................................................................................................................... 404

    Creating a PDSE Member with BSAM or QSAM............................................................................404

    xiii

  • Adding or Replacing PDSE Members Serially.............................................................................. 405Adding or Replacing Multiple PDSE Members Concurrently....................................................... 406Copying a PDSE or Member to Another Data Set.........................................................................406

    Processing a Member of a PDSE........................................................................................................ 407Establishing Connections to Members.........................................................................................407Using the BLDL Macro to Construct a Directory Entry List.......................................................... 408Using the BSP Macro to Backspace a Physical Record................................................................408Using the Directory Entry Services...............................................................................................408Using the FIND Macro to Position to the Beginning of a Member............................................... 415Using ISITMGD to Determine Whether the Data Set Is System Managed..................................415Using the NOTE Macro to Provide Relative Position.................................................................... 416Using the POINT Macro to Position to a Block.............................................................................417Switching between Members....................................................................................................... 417Using the STOW Macro to Update the Directory..........................................................................418

    Retrieving a Member of a PDSE......................................................................................................... 419Sharing PDSEs.................................................................................................................................... 420

    Sharing within a Computer System..............................................................................................420Sharing Violations.........................................................................................................................421Multiple System Sharing of PDSEs............................................................................................... 421Normal or Extended PDSE Sharing.............................................................................................. 423

    Modifying a Member of a PDSE..........................................................................................................424Updating in Place..........................................................................................................................424Extending a PDSE Member...........................................................................................................425Deleting a PDSE Member..............................................................................................................425Renaming a PDSE Member...........................................................................................................425

    Reading a PDSE Directory.................................................................................................................. 426Concatenating PDSEs.........................................................................................................................426

    Sequential Concatenation............................................................................................................ 426Partitioned Concatenation............................................................................................................426

    Converting PDSs to PDSEs and Back.................................................................................................427PDSE to PDS Conversion.............................................................................................................. 427Restrictions on Converting PDSEs................................................................................................428

    Improving Performance..................................................................................................................... 428Recovering Space in Fragmented PDSEs...........................................................................................428PDSE Address Spaces........................................................................................................................ 428

    Planning to use the restartable PDSE address space..................................................................429Setting up the SMSPDSE1 address space....................................................................................430Hiperspace caching for PDSE....................................................................................................... 431PDSE Address Space Tuning........................................................................................................ 432

    PDSE Diagnostics............................................................................................................................... 434

    Chapter 28. Processing z/OS UNIX Files................................................................................................ 435Accessing the z/OS UNIX File System............................................................................................... 435

    Using a non-SMS managed data set for a zFS version root larger than four gigabytes.............. 436Characteristics of UNIX Directories and Files..............................................................................436Access Methods Used.................................................................................................................. 436

    Using HFS Data Sets...........................................................................................................................437Creating HFS Data Sets................................................................................................................ 438Creating Additional Directories.................................................................................................... 438

    Creating z/OS UNIX Files................................................................................................................... 439Writing a UNIX File with BSAM or QSAM......................................................................................439Creating a UNIX File Using JCL.................................................................................................... 441JCL Parameters for UNIX Files.....................................................................................................442Creating a Macro Library in a UNIX Directory.............................................................................. 444

    Managing UNIX Files and Directories................................................................................................ 445Specifying Security Settings for UNIX Files and Directories....................................................... 445Editing UNIX Files.........................................................................................................................446Using ISHELL to Manage UNIX Files and Directories.................................................................. 446

    xiv

  • Copying UNIX Files or Directories................................................................................................448Services and Utilities for UNIX Files..................................................................................................449

    Services and Utilities Cannot be Used with UNIX Files...............................................................449z/OS UNIX Signals........................................................................................................................ 450z/OS UNIX Fork Service................................................................................................................ 450SMF Records................................................................................................................................. 450

    Reading UNIX Files Using BPAM........................................................................................................450Using Macros for UNIX Files.........................................................................................................450BLDL—Constructing a Directory Entry List................................................................................... 450CHECK—Checking for I/O Completion......................................................................................... 451CLOSE—to Close the DCB............................................................................................................. 451FIND—Positioning to the Starting Address of a File.................................................................... 451READ—Reading a UNIX File..........................................................................................................452STOW DISC—Closing a UNIX File................................................................................................. 452

    Concatenating UNIX Files and Directories........................................................................................ 452Sequential Concatenation........................................................