Guide to VMS File Applications

*HyperReader

  CONTENTS

  Title Page

  Copyright Page

  Preface

  1      Introduction

  1.1     File Concepts
    1.1.1      Disk Concepts
      1.1.1.1      Logical Structures
      1.1.1.2      Physical Structures
      1.1.1.3      Files-11 On-Disk Structure Index File
    1.1.2      Tape Concepts

  1.2     Volume Protection

  1.3     Record Management Services
    1.3.1      File Definition Language (FDL)
    1.3.2      VMS RMS Data Structures
    1.3.3      VMS RMS Services

  1.4     VMS RMS Utilities
    1.4.1      The Analyze/RMS_File Utility
    1.4.2      The Convert Utility
    1.4.3      The Convert/Reclaim Utility
    1.4.4      The Create/FDL Utility
    1.4.5      The Edit/FDL Utility

  1.5     Process and System Resources for File Applications
    1.5.1      Memory Requirements
    1.5.2      Process Limits

  2      Choosing a File Organization

  2.1     Record Concepts
    2.1.1      Record Access Modes
      2.1.1.1      Sequential Access
      2.1.1.2      Random Access by Key Value or Relative Record Number
      2.1.1.3      Random Access by Record File Address
    2.1.2      Record Formats
      2.1.2.1      Fixed-Length Record Format
      2.1.2.2      Variable-Length Record Format
      2.1.2.3      Variable-Length with Fixed-Length Control Field (VFC) Record Format
      2.1.2.4      Stream Record Format

  2.2     File Organization Concepts
    2.2.1      Sequential File Organization
    2.2.2      Relative File Organization
    2.2.3      Indexed File Organization
      2.2.3.1      Sequentially Retrieving Indexed Records
      2.2.3.2      Index Keys
      2.2.3.3      Other Key Characteristics
      2.2.3.4      Specifying Sort Order
      2.2.3.5      Using Collated Keys
      2.2.3.6      Summary of Indexed File Organization

  3      Performance Considerations

  3.1     Design Considerations
    3.1.1      Speed
    3.1.2      Space
    3.1.3      Shared Access
    3.1.4      Impact on Applications Design

  3.2     Tuning
    3.2.1      File Design Attributes
      3.2.1.1      Initial File Allocation
      3.2.1.2      Contiguity
      3.2.1.3      Extending a File
        3.2.1.3.1       Auto-Extend Size Selection
        3.2.1.3.2       Establishing Auto-Extend Default Quantities
        3.2.1.3.3       Placement and Contiguity of Extends
      3.2.1.4      Truncating a File
      3.2.1.5      Units of I/O
      3.2.1.6      Multiple Areas for Indexed Files
      3.2.1.7      Bucket Fill Factor for Indexed Files
    3.2.2      Processing Options
      3.2.2.1      Multiple Buffers
      3.2.2.2      Deferred-Write Processing
      3.2.2.3      Global Buffers
      3.2.2.4      Read-Ahead and Write-Behind Processing

  3.3     Tuning a Sequential File
    3.3.1      Block Spanning Option
    3.3.2      Multiblock Size Option
    3.3.3      Number Of Buffers
    3.3.4      Global Buffer Option
    3.3.5      Read-Ahead and Write-Behind Options

  3.4     Tuning a Relative File
    3.4.1      Bucket Size
    3.4.2      Number of Buffers
    3.4.3      Global Buffer Option
    3.4.4      Deferred-Write Option

  3.5     Tuning an Indexed File
    3.5.1      File Structure
      3.5.1.1      Prologs
      3.5.1.2      Primary Index Structure
      3.5.1.3      Alternate Index Structure
      3.5.1.4      Records
      3.5.1.5      Keys
      3.5.1.6      Areas
    3.5.2      Optimizing File Performance
      3.5.2.1      Bucket Size
      3.5.2.2      Fill Factor
      3.5.2.3      Number Of Buffers
      3.5.2.4      Global Buffers
      3.5.2.5      Using the Deferred-Write Option

  3.6     Monitoring VMS RMS Performance
    3.6.1      Enabling RMS Statistics
    3.6.2      Using RMS Statistics

  3.7     Processing in a VAXcluster
    3.7.1      VAXCluster Shared Access
      3.7.1.1      Locking Considerations
      3.7.1.2      I/O Considerations
    3.7.2      Performance Recommendations

  4      Creating and Populating Files

  4.1     File Creation Characteristics
    4.1.1      Using VMS RMS Control Blocks
      4.1.1.1      File Access Block
      4.1.1.2      Extended Attribute Blocks
    4.1.2      Using File Definition Language
      4.1.2.1      Using EDIT/FDL
      4.1.2.2      Designing an FDL File
      4.1.2.3      Setting Characteristics For FDL Files
    4.1.3      Using the FDL Routines

  4.2     Creating a File
    4.2.1      Using the VMS RMS Create Service
    4.2.2      Using the Create/FDL Utility
    4.2.3      Using the Convert Utility
    4.2.4      Using the FDL$CREATE Routine

  4.3     Creating and Accessing Tagged Files
    4.3.1      Programming Interface for File Tagging
    4.3.2      Accessing a Tagged File
      4.3.2.1      File Accesses That Do Not Sense Tags
      4.3.2.2      File Accesses That Sense Tags
    4.3.3      Preserving Tags

  4.4     Defining File Protection
    4.4.1      UIC-Based Protection
    4.4.2      ACL-Based Protection

  4.5     Populating a File
    4.5.1      Using the Convert Utility
    4.5.2      Using the Convert Routines

  4.6     Summary of File-Creation Options
    4.6.1      File-Creation Options
    4.6.2      File Characteristics
    4.6.3      File Allocation and Positioning

  5      Locating and Naming Files

  5.1     Understanding File Specifications
    5.1.1      File Specification Formats
      5.1.1.1      Local Node
      5.1.1.2      Remote Node
    5.1.2      Using File Specification Defaults

  5.2     Logical Names and Parsing
    5.2.1      Image Activation Using Logical Names
    5.2.2      Example Use of Logical Names
    5.2.3      Types of Logical Names
    5.2.4      Introduction to File Parsing

  5.3     Using One File Specification to Locate Many Files
    5.3.1      Processing One File
    5.3.2      Processing Many Files
    5.3.3      Processing One or Many Files

  6      Advanced Use of File Specifications

  6.1     How VMS RMS Applies Defaults

  6.2     Understanding VMS RMS Parsing
    6.2.1      Checking for Open-By-Name Block
    6.2.2      File Specification Formats and Translating Logical Names
    6.2.3      Special Parsing Conventions
      6.2.3.1      Parsing Conventions for a Search List
      6.2.3.2      Special Processing for a Related File Specification
      6.2.3.3      Input File Specification Parsing
      6.2.3.4      Output File Specification Parsing

  6.3     Directory Syntax Conventions and Directory Concatenation
    6.3.1      Using Normal Directory Syntax
    6.3.2      Rooted-Directory Syntax Applications
    6.3.3      Using Rooted-Directory Syntax
    6.3.4      Concatenating Rooted-Directory Specifications
    6.3.5      An Example of Using a Rooted Directory

  6.4     Using Process-Permanent Files

  7      File Sharing and Buffering

  7.1     File Accessing
    7.1.1      Types of File Sharing and Record Streams
    7.1.2      Interlocked Interprocess File Sharing
    7.1.3      User-Interlocked Interprocess File Sharing

  7.2     Record Locking
    7.2.1      Default Record Locking
    7.2.2      Record Locking Options
      7.2.2.1      Exclusive Locking
      7.2.2.2      Write Locking
      7.2.2.3      Read Locking
      7.2.2.4      No Locking
      7.2.2.5      Put Service Considerations
      7.2.2.6      Summary
    7.2.3      Handling Record Locking Conflicts
      7.2.3.1      Handling the Record-Locked Error
      7.2.3.2      Waiting for Locked Records
      7.2.3.3      Reading Regardless of Lock
    7.2.4      Miscellaneous Record Locking Options
      7.2.4.1      Manual-Unlocking Option
      7.2.4.2      Lock-Nonexistent-Record Option
    7.2.5      Record Locking Deadlocks

  7.3     Local and Shared Buffering Techniques
    7.3.1      Record Transfer Modes
    7.3.2      Understanding Buffering
    7.3.3      Buffering for Sequential Files
    7.3.4      Buffering for Relative Files
    7.3.5      Buffering for Indexed Files
    7.3.6      Using Global Buffers for Shared Files

  8      Record Processing

  8.1     Record Operations

  8.2     Primary VMS RMS Services
    8.2.1      Locating and Retrieving Records
    8.2.2      Inserting Records
    8.2.3      Updating Records
    8.2.4      Deleting Records

  8.3     Secondary VMS RMS Services

  8.4     Record Access for the Various File Organizations
    8.4.1      Processing Sequential Files
      8.4.1.1      Sequential Access
      8.4.1.2      Random Access
    8.4.2      Processing Relative Files
      8.4.2.1      Sequential Access
      8.4.2.2      Random Access
    8.4.3      Processing Indexed Files
      8.4.3.1      Sequential Access
      8.4.3.2      Random Access
    8.4.4      Access by Record File Address (RFA)

  8.5     Block Input/Output

  8.6     Current Record Context
    8.6.1      Current-Record Position
    8.6.2      Next-Record Position

  8.7     Synchronous and Asynchronous Operations
    8.7.1      Using Synchronous Operations
    8.7.2      Using Asynchronous Operations

  9      Run-Time Options

  9.1     Specifying Run-Time Options
    9.1.1      Using the FDL Editor
    9.1.2      Using Language Statements and VMS RMS

  9.2     Options Related to Opening and Closing Files
    9.2.1      File Access and Sharing Options
    9.2.2      File Specifications
    9.2.3      File Performance Options
      9.2.3.1      Extension Size
      9.2.3.2      Window Size
      9.2.3.3      Summary of Performance Options
    9.2.4      Record Access Options
    9.2.5      Options for Adding Records
    9.2.6      Options for Data Reliability
    9.2.7      Options for File Disposition
    9.2.8      Options for Indexed Files
    9.2.9      Options for Magnetic Tape Processing
    9.2.10     Options for Nonstandard File Processing

  9.3     Summary of Record Operation Options
    9.3.1      Record Retrieval Options
    9.3.2      Put Service Options
    9.3.3      Record Update Options
    9.3.4      Record Deletion Options

  9.4     Run-Time Example

  10     Maintaining Files

  10.1    Viewing File Characteristics
    10.1.1     Performing an Error Check
    10.1.2     Generating a Statistics Report
    10.1.3     Using Interactive Mode
    10.1.4     Examining a Sequential File
    10.1.5     Examining a Relative File
    10.1.6     Examining an Indexed File

  10.2    Generating an FDL File from a Data File

  10.3    Optimizing and Redesigning File Characteristics
    10.3.1     Redesigning an FDL File
    10.3.2     Optimizing a Data File

  10.4    Making a File Contiguous
    10.4.1     Using the Copy Utility
    10.4.2     Using the Convert Utility
    10.4.3     Reclaiming Buckets in Prolog 3 Files

  10.5    Reorganizing a File

  10.6    Making Archive Copies

  A   EDIT/FDL Optimization Algorithms

  A.1     Allocation

  A.2     Extension Size

  A.3     Bucket Size

  A.4     Global Buffers

  A.5     Index Depth

  GLOSSARY

  EXAMPLES

  2-1        Creating a File Containing Collated Keys

  4-1        Sample FDL Edit Session

  4-2        Sample FDL File

  4-3        Using FDL Routines in a Pascal Program

  4-4        Using the FDL$CREATE Routine in a FORTRAN Program

  4-5        Using the FDL$CREATE Routine from a COBOL Program

  4-6        Tagging a File

  4-7        Accessing a Tagged File

  4-8        Using the CONVERT Routines in a FORTRAN Program

  4-9        Using the CONVERT Routines in a COBOL Program

  5-1        Using Logical Names for Remote File Access

  5-2        Selecting the USEROPEN Option to Call a Routine

  5-3        Using the Parse, Search, and Open Services

  6-1        Example of Rooted-Directory Syntax

  7-1        Designing a Pause between Attempts to Access a Record

  9-1        Specifying Run-Time Attributes

  9-2        Using the FDL$PARSE and FDL$RELEASE Routines

  10-1       Using ANALYZE/RMS_FILE to Create a Check Report

  10-2       Using ANALYZE/RMS_FILE to Create a Statistics Report

  10-3       Examining a Sequential File

  10-4       Examining a Relative File

  10-5       Examining an Area Descriptor Path

  10-6       Examining a Primary Record

  10-7       Examining an Alternate Record

  10-8       KEY and ANALYSIS_OF_KEY Sections in an FDL File

  FIGURES

  1-1        Files-11 On-Disk Structure Hierarchy

  1-2        Single and Multiple File Extents

  1-3        Tracks and Cylinders

  1-4        Interrecord Gaps

  1-5        Using CONVERT to Create a Data File

  1-6        Using CREATE/FDL to Create an Empty Data File

  2-1        Sequential Access to a Sequential File

  2-2        Sequentially Retrieving Records in a Relative File

  2-3        Sequentially Storing Records in a Relative File

  2-4        Random Access by Relative Record Number

  2-5        Random Access by Record File Address

  2-6        Comparison of Fixed- and Variable-Length Records

  2-7        Writing a VFC Record to a File

  2-8        Retrieving a VFC Record

  2-9        Sequential File Organization

  2-10       Relative File Organization

  2-11       Variable-Length Records in Fixed-Length Cells

  2-12       Single-Key Indexed File Organization

  2-13       Multiple-Key Indexed File Organization

  3-1        VMS RMS Index Structure

  3-2        A Primary Index Structure

  3-3        Finding the Record with Key 14

  4-1        A Line_Plot Graph

  4-2        A Surface_Plot Graph

  4-3        Design Mnemonics

  7-1        Shared File Access

  7-2        VMS RMS Buffers and the Application Program

  7-3        Using Global Buffers for a Shared File

  8-1        Using RFA Access to Establish Record Position

  10-1       Tree Structure for Sequential Files

  10-2       Record Layout and Content for SEQ.DAT

  10-3       Tree Structure of Relative Files

  10-4       An Area Descriptor Path

  10-5       A Key Descriptor Path

  10-6       Structure of Primary Records

  10-7       Structure of Alternate Records

  10-8       The VMS RMS Tuning Cycle

  TABLES

  2-1        Supported Record Access Modes and File Organizations

  2-2        File Organization Characteristics

  2-3        Sequential File Organization: Advantages and Disadvantages

  2-4        Relative File Organization: Advantages and Disadvantages

  2-5        Indexed File Organization: Advantages and Disadvantages

  4-1        Summary of EDIT/FDL Commands

  4-2        EDIT/FDL scripts

  6-1        File Specification Defaults

  6-2        Example of Applying Defaults

  7-1        File Access Record Operations

  7-2        File Sharing Record Operations

  7-3        Initial File Sharing and Subsequent File Access

  7-4        Initial File Access and Subsequent File Sharing

  7-5        Compatibility of Record locking options

  8-1        Record Operations and File Organizations

  8-2        Record Access Stream Context

  10-1       ANALYZE/RMS_FILE Command Summary