link to main US Geological Survey website
U.S. Geological Survey
Open-File Report 2005-1424
Version 1.2

libvaxdata: VAX Data Format Conversion Routines

By Lawrence M. Baker

2005, revised 2010


libvaxdata provides a collection of routines for converting numeric data—integer and floating-point—to and from the formats used on a Digital Equipment Corporation1 (DEC) VAX 32-bit minicomputer (Brunner, 1991). Since the VAX numeric data formats are inherited from those used on a DEC PDP-11 16-bit minicomputer, these routines can be used to convert PDP–11 data as well. VAX numeric data formats are also the default data formats used on DEC Alpha 64-bit minicomputers running OpenVMS

The libvaxdata routines are callable from Fortran or C. They require that the caller use two's-complement format for integer data and IEEE 754 format (ANSI/IEEE, 1985) for floating-point data. They also require that the "natural" size of a C int type (integer) is 32 bits. That is the case for most modern 32-bit and 64-bit computer systems. Nevertheless, you may wish to consult the Fortran or C compiler documentation on your system to be sure.

Some Fortran compilers support conversion of VAX numeric data on-the-fly when reading or writing unformatted files, either as a compiler option or a run-time I/O option. This feature may be easier to use than the libvaxdata routines. Consult the Fortran compiler documentation on your system to determine if this alternative is available to you.

1Later Compaq Computer Corporation, now Hewlett-Packard Company

Text of this report as a 14-page PDF file (of2005-1424_v1.2.pdf; 216 KB)

libvaxdata.tar.gz Compressed tar format with Unix/Linux/Mac OS X-style LF line endings (25 KB) ZIP format with MS-DOS-style CR-LF line endings (44 KB)

For questions about the content of this report, contact Larry Baker

Version history

Download a free copy of the current version of Adobe Reader.

| Help | PDF help | Publications main page | Western Open-File Reports for 2005 |
| Privacy Statement | Disclaimer | Accessibility |
| Geologic Division | Earthquake Hazards Program |

This report is available only on the Web

| Department of the Interior | U.S. Geological Survey |
URL of this page:
Maintained by: Michael Diggles
Date created: January 6, 2006
Date last modified: July 16, 2010 (mfd)