HP OpenVMS Systems Documentation

Guide to OpenVMS File Applications

The Update service (or equivalent language statement) modifies an
existing record in a file. Your program must first locate the
appropriate record position and optionally retrieve the record itself
by calling the Find or Get service (or equivalent language statement).

The options associated with the Update service are summarized in the
following table. These options can be set for each Update
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.

FDL: CONNECT ASYNCHRONOUS

RMS: RAB$L_ROP RAB$V_ASY

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.

FDL: None

RMS: RAB$L_RHB

Record buffer
address

Specifies the address of the record buffer that contains the record to
be written.

FDL: None

RMS: RAB$L_RBF

Record buffer size

Specifies the size of the records contained in the record buffer to be
written.

The Delete service (or equivalent language statement) removes a record
from the file. You cannot use this service for sequential files;
however, a sequential file can be truncated using the Truncate service.
Like the Update service, the Delete service must be preceded by a Find
or Get service to establish the current record position.

The options associated with the Delete service are summarized in the
following table. These options can be set for each Delete
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 service will be asynchronous.

FDL: CONNECT ASYNCHRONOUS

RMS: RAB$L_ROP RAB$V_ASY

Fast delete

Specifies that the record to be deleted is flagged as deleted, but
parts of any alternate index key path are not completely erased until a
subsequent access using the alternate key occurs. This makes deleting
the record occur more quickly, but it requires additional access time
for a subsequent Find or Get service.

Designing and creating your files and defining their records are only
the first steps in the life cycle of your file. You must also consider
maintaining the file.

This chapter describes file maintenance with the emphasis on file
tuning.

Section 10.1 describes how you can use the Analyze/RMS_File utility to
view the characteristics of a file. Section 10.2 describes how you can
create an FDL file from a data file using the Analyze/RMS_File utility.
Section 10.3 explains how to use the Edit/FDL utility, particularly
with Analyze/RMS_File, to optimize and redesign file characteristics.
Section 10.4 describes how to make a file contiguous. Section 10.5
explains how to reorganize a file, and Section 10.6 describes how to
make archive copies of a file.

The Analyze/RMS_File utility (ANALYZE/RMS_FILE) allows you to inspect
and analyze the internal structure of an OpenVMS RMS (hereafter
referred to as RMS) file.

ANALYZE/RMS_FILE can check a file's structure for errors and can
generate a statistical or summary report. A summary report is identical
to a statistical report except that no checking is done. For more
information on producing a summary report, see the description of the
Analyze/RMS_File utility in the OpenVMS Record Management Utilities Reference Manual.

You can also inspect and analyze your file using the Analyze/RMS_File
utility interactively. The analysis can show whether or not the file is
properly designed for its application and can point out ways to improve
the file design.

In addition, you can use ANALYZE/RMS_FILE to obtain FDL files from data
files. You can then use these FDL files with the Create/FDL utility
(CREATE/FDL), the Convert utility (CONVERT), and the Edit/FDL utility,
(EDIT/FDL). FDL files created with ANALYZE/RMS_FILE contain special
analysis sections for each area and key, which are called
ANALYSIS_OF_AREA and ANALYSIS_OF_KEY. The Edit/FDL
utility uses these sections in the Optimize script to tune the file's
structure.

To check a file's structure for errors, use the following command
syntax:

ANALYZE/RMS_FILE/CHECK filespec

By default with a command of this format, the Check report is displayed
on the terminal (SYS$OUTPUT).

If you receive any error messages, the file has been corrupted by a
serious error. If you have had a hardware problem such as a power
failure or a disk head failure, then the hardware probably caused the
corruption. If you have not had any hardware problems, then a software
error may have caused the corruption. Note that the /CHECK qualifier
does not find all types of file corruption, however.

In either case, you can try using the Convert utility to fix the
problem by using the file specification as both the
input-filespec and the
output-filespec. Note that if you are processing a
relative file containing deleted or unused records, the conversion
process changes relative record numbers (RRN) in the output file. If
the conversion does not correct the problem, use the Backup utility
(BACKUP) to bring in the backup copy of the file.

If you believe that the software caused the error, contact a Compaq
support representative. Supply the ANALYZE/RMS_FILE check report, a
copy of the data file, and a description of what was done with the data
file. If possible, also supply a version of the file prior to the
corruption and the program or procedure which led to the corruption;
being able to reproduce the problem is of tremendous value.

Example 10-1 is a sample Check report of a file with the file
specification DISK$:[HERBER]CUSTDATA.DAT;2.

The Check report will be placed in the file you named with the
output-filespec parameter. This file will receive the
file type .ANL by default. For example, the following command will
perform an error check on PRLG2.IDX and place the Check report in the
file ERROR.ANL:

For indexed files, the Statistics report consists of the Check report
plus additional information about the areas and keys in the file. (A
Statistics report on a sequential or relative file is thus the same as
a Check report.)

To generate a Statistics report with ANALYZE/RMS_FILE, enter a DCL
command of the form: