...a Disc Interchange technical article
VAX VMS and Open VMS File Types
The VAX VMS and Open VMS operating systems have a rich set of file types. This adds complexity to conversion of files to
and from VMS.
For a successful conversion to a PC file, the parameters of each VMS file need to be properly considered. This page
briefly discusses VMS disk file types and VMS tape formats.
VMS Disk Files
Each file stored on a VMS disk has a File Definition header associated with it. You can see the values in this header by
issuing the DIRECTORY /FULL <FILENAME> command. There is a lot of information about each file, but the three items
of concern for conversion are:
1. File Organization - The file organization may be:
- File Organization
- Record Format
- Record Attributes
2. Record Format - There are four VMS record formats:
- Sequential - Sequential VMS files will convert to sequential files on other platforms
- Relative - Relative files can often be read sequentially and converted to a PC sequential file.
- Indexed - Indexed files typically must be converted to sequential files on VMS, then the sequential file is
converted to a PC file.
3. Record Attributes - The attributes of a VMS record are:
- Fixed Length - In a Fixed-Length record file all the records are fixed length, and all are the same size.
The record size is known to VMS and is stored in the File Definition header. The record attributes (below) for fixed
length files are usually "none".
- Variable Length - Variable Length format is used for data files with variable size records, and also for
text files. The length of each record is stored with the contents of the record (see "Common VMS File Types, below,
for more), and the size of the largest record in the file is known to the File Definition header.
- Stream - Stream files are just a "stream of bytes" stored on disk. They may have carriage control codes,
such as a line feed, embedded within the file.
- VFC - VFC files, which stands for "Variable with Fixed Control" contain a record length code, followed by
a "fixed" portion of the record, followed by a variable portion. The fixed portion is used to store data that is
consistent between records (such as line numbers in a source file), and the variable portion stores the remainder of
the record or line, which varies in length.
Common VMS File Types
The file parameters listed above, file organization, record format, and record attributes, combine to specify the type of
VMS file. As you can see, there are many possible combinations. This section briefly describes a few of the more common
file types. Indexed and Relative files are beyond the scope of this discussion, but DISC can usually convert them to
other platforms without problem. The following information pertains to sequential files only.
- None - means there is no carriage control (i.e. record delimiters), as in the case of fixed length
- Carriage Return Carriage Control - means there is an "implied carriage return" at the end of each line.
The CR-LF is not actually stored in the file, but is "implied"; see "Common VMS File Types", below for an
- FORTRAN Carriage Control - uses the first character of each record to indicate the carriage control
- Print Carriage Control - stores the carriage control information in the fixed portion of a VFC file.
Fixed Length Records
Sequential data files under VMS are commonly fixed length, without carriage control. This type of file is stored as a
series of fixed length records, all the same size, with no carriage control (i.e. record delimiters). The record size is
contained in the file header. This file type will convert nicely to fixed length records with no record delimiters on
other systems. DISC can add record delimiters to the file after conversion, if needed.
Another use for fixed length record files is to store raw binary data, and executable files. Fixed length 512 byte
records are used for both purposes. Graphic and CAD programs, for example, commonly store their data in files that are
"fixed length, 512 byte records". While this is usually raw data with no defined record length, VMS treats it as fixed
length records of 512 bytes each, and stores and returns the data 512 bytes at a time. These files can be transferred to
a PC in binary format, preserving the raw data.
Variable Length Records
Text files and some variable length data files under VMS are stored as "variable length" with "carriage return carriage
control". When you type such a file on VMS, it displays as lines of varying length, with CR-LF carriage control between
lines. However, on disk each line (record) is actually stored as a 2 byte binary length code followed by the content of
the line, and possibly a pad byte; there is no actual CR or LF stored on the disk. When converting to other platforms,
we interpret the length code, but do not actually transmit it to the other system. We convert the content of the VMS
line to a line of text on the new platform, and terminate it with the appropriate record delimiter for the new platform,
usually a CR, LF, or CR-LF pair.
Stream files store data as a stream of bytes with no defined record structure. Stream files are often used by
applications (such as a word processor) when writing proprietary files. Stream-Linefeed files are stream files which
contain an actual linefeed byte as the delimiter.
Other File Types
Most VMS files can be transferred to other platforms in binary format, which means each byte of the file on the VMS disk
is copied to the new platform without change. Although this will accurately reproduce the VMS file on the new system,
the file may not be usable. For example, a VMS text file transferred in binary mode will still contain the two byte
binary length code, followed by the line of text (and possibly a pad byte), and no CR or LF.
Binary transfer is useful when transferring binary coded application files to a new platform that uses the same binary
file type. For example, a CAD file which will be opened by the same CAD program on the new system. Transferring index
files or other proprietary binary format files is generally not a useful thing to do. VAX executables (.EXE files) are
compiled for the VAX CPU and will not run on another CPU, such as a PC.
VMS Tape Formats
Most VAX tapes are written in either VMS Backup format, or VMS COPY format. VAX can also write Unlabeled tapes in fixed
block format, and in a variable block format where the size of each block varies, depending on the record it contains.
DISC can convert all these formats, but VMS Backup is generally the preferred format.
The file parameters discussed above are stored on the tape with the file, so the correct file type is created on the VMS
disk when restoring from a Backup or COPY tape. Backup stores all the file parameters for all file types, including
indexed. COPY stores a subset of the file parameters, and is adequate for most fixed and variable length sequential files.
Backup stores the full path and file name; COPY stores only the file name. Backup is the better choice when sending files
to DISC for conversion.
All media supported by VMS record files in the same manner. That is, they all have identical file structures, from 9-track
to TK-50, to DLT, to 3480, to QIC. Regardless of the media used, VMS records to the tape in the same way.
DISC can also create a CD in VAX VMS format, containing normal VMS disk files, Backup Savesets, or install files. And if
you need to distribute quantities of CDs we can get the CDs duplicated and silk screened, too.