| 
     
 
 
  
 
  
 
  
 
  
 
  
 
  
 
          | 
     
| Updated: 11 December 1998 | 
 
 
Guide to OpenVMS File Applications
| Previous | Contents | Index | 
You can specify the record access for a record stream as sequential, 
random by key or record number, or random by RFA. (See Section 8.1.) 
The selected record access can be changed for each record processing 
operation. These options can be set using the RAB$B_RAC field, values 
RAB$C_SEQ, RAB$C_KEY, and RAB$C_RFA.
9.2.5 Options for Adding Records
When adding records to a file, consider the open and connection options in the following table:
| Option | Description | 
|---|---|
| 
      Default extension
       quantity 1  | 
    See Section 9.2.3. | 
| Deferred-write 1 | See Section 9.2.3. | 
| End-of-file | 
      After the record stream is connected, the record context is positioned 
      to the end of the file.
      
  | 
  
| 
      Retrieval window
       size 1  | 
    See Section 9.2.3. | 
| Revision data | 
      The revision date and time and the revision number can be specified to 
      be a value other than the actual revision date and time and revision 
      number when the file is closed. These options must be set while the 
      file is open and thus cannot be set using FDL.
      
  | 
  
| Truncate on Put 1 | 
      When using sequential record access for sequential files only, the 
      record to be written is the last record in the file, and RMS truncates 
      the file just beyond that record.
      
  | 
  
| Update-if 1 | 
      If you set this option and your program tries to replace an existing 
      record while adding records randomly to a file, RMS modifies the 
      existing record instead of replacing it. When using this option for 
      indexed files, note that the file must
      not allow duplicates for the primary key. Use this option 
      carefully with a shared file (see Section 8.1).
      
  | 
  
| Write-behind 1 | See Section 9.2.3. | 
The following table lists the run-time file open options that apply to data reliability:
| Option | Description | 
|---|---|
| Read-check | 
      Specifies that transfers from volumes are to be checked by a 
      read-compare operation, which effectively doubles the amount of disk 
      I/O performed. This option is not available for all devices (see the 
      OpenVMS Record Management Services  Reference Manual.)
      
  | 
  
| Write-check | 
      Specifies that transfers to volumes are to be checked by a read-compare 
      operation, which effectively doubles the amount of disk I/O performed. 
      This option is not available for all devices (see the OpenVMS Record Management Services  Reference Manual).
      
  | 
  
The run-time file open options that apply to file disposition are listed in the following table. These options can only be selected while the file is open.
The following table lists the run-time options that apply to indexed file processing. For more information about processing indexed files, refer to Section 8.4.3.
The run-time file open and close options that apply to magnetic tape processing are listed in the following table:
The following table lists the run-time file open options that apply to nonstandard file processing:
This section briefly describes the options associated with the record 
retrieval services (Find and Get), the record insertion service (Put), 
the record modification service (Update), and the record deletion 
service (Delete).
9.3.1 Record Retrieval Options
The Find and Get services (or the equivalent language statements) can be used to locate and retrieve a record.
The options associated with the Find and Get services are summarized in the following table. These options can be set for each Find or Get service if the program can access the appropriate RAB control block fields. The RAB control block fields are preset by connect-time values or defaults and as a result of previous service calls.
The Put service (or equivalent language statement) adds a record to the file.
The options associated with the Put service are summarized in the following table. These options can be set for each Put service if the program can access the appropriate RAB control block fields. The RAB control block fields are preset by connect-time values or defaults and as a result of previous service calls.
| Option | Description | 
|---|---|
| 
      Asynchronous record
       processing  | 
    
      Specifies that record I/O for this record stream is done asynchronously.
      
      
               
      
               
  | 
  
| Key buffer | 
      When adding records randomly to a relative file, the specified key 
      buffer must contain the desired record's relative record number.
      
      
               
      
               
      
               
  | 
  
| Key size | 
      When adding records to a relative file using random record access, this 
      field must specify a value of 4 (the default value provided by RMS).
      
      
               
      
               
  | 
  
| Load buckets | 
      When adding records, the buckets fill to the level specified when the 
      file is created. The default is that buckets fill completely before a 
      bucket split occurs.
      
      
               
      
               
  | 
  
| Read allowed | 
      Allows the locked record being written to be read.
      
      
               
      
               
  | 
  
| Record access | 
      Specifies the way records are added, sequentially according to 
      ascending key value or relative record number, randomly by key (indexed 
      files) or by record number (relative files), or randomly by RFA.
      
      
               
      
               
      
               
      
               
  | 
  
| Record header buffer | 
      Contains the symbolic address of the record header buffer that contains 
      the fixed portion of a VFC record. Applies to the Get service only.
      
      
               
      
               
      
               
  | 
  
| 
      Record buffer
       address  | 
    
      Specifies the address of the record buffer that contains the record to 
      be written.
      
      
               
      
               
  | 
  
| Record buffer size | 
      Specifies the size of the record contained in the record buffer to be 
      written.
      
      
               
  | 
  
| Timeout period | 
      This option is used with the wait-if-locked option to specify a timeout 
      period after which an error is returned. The number of seconds is 
      specified by the CONNECT TIMEOUT_PERIOD or the RAB$B_TMO field to 
      eliminate a potential deadlock.
      
      
               
      
               
  | 
  
| Truncate on Put | 
      Specifies that the file is truncated at the record being added. 
      Requires sequential record access and only applies to sequential files.
      
      
               
      
               
  | 
  
| Update-if | 
      Turns the Put service into an update operation if the record already 
      exists in the file. Care must be taken when using this option with 
      shared files and automatic record locking (see Section 8.1). When 
      using this option with indexed files, note that the file must not allow 
      duplicates for the primary key. This option can only be used when 
      random record access has been specified.
      
      
               
      
               
  | 
  
| Write-behind | 
      Improves performance at the expense of additional memory for I/O 
      buffers. Requires sequential record access and only applies to 
      sequential files.
      
      
               
      
               
  | 
  
| Previous | Next | Contents | Index | 
 
 
 
  
 
  
 
  
 
  
 
  
 
  
      | 
 
           |  
     
|  
              
 
              
            Copyright © Compaq Computer Corporation 1998. All rights reserved. Legal |  
     
 
           
           
4506PRO_025.HTML
           
           
          |