The CONVERT specifier indicates a nonnative numeric format for unformatted data. It takes the following form:
CONVERT = fm
'LITTLE_ENDIAN' [1] | Little endian integer data [2] and IEEE® floating-point data [3]. |
'BIG_ENDIAN' [1] | Big endian integer data [2] and IEEE floating-point data [3]. |
'CRAY' | Big endian integer data [2] and CRAY® floating-point data of size REAL(8) or COMPLEX(8). |
'FDX' | Little endian integer data [2] and Compaq VAXTM floating-point data of format F_floating for REAL(4) or COMPLEX(4), D_floating for size REAL(8) or COMPLEX(8), and IEEE X_floating for REAL(16). |
'FGX' | Little endian integer data [2] and Compaq VAX floating-point data of format F_floating for REAL(4) or COMPLEX(4), G_floating for size REAL(8) or COMPLEX(8), and IEEE X_floating for REAL(16). |
'IBM' | Big endian integer data [2] and IBM® System\370 floating-point data of size REAL(4) or COMPLEX(4) (IBM short 4), and size REAL(8) or COMPLEX(8) (IBM long 8). |
'VAXD' | Little endian integer data [2] and Compaq VAX floating-point data of format F_floating for size REAL(4) or COMPLEX(4), D_floating for size REAL(8) or COMPLEX(8), and H_floating for REAL(16). |
'VAXG' | Little endian integer data [2] and Compaq VAX floating-point data of format F_floating for size REAL(4) or COMPLEX(4), G_floating for size REAL(8) or COMPLEX(8), and H_floating for REAL(16). |
'NATIVE' | No data conversion. This is the default. |
[1] INTEGER(1) data is the same for little endian and big
endian.
|
You can use CONVERT to specify multiple formats in a single program,
usually one format for each specified unit number.
When reading a nonnative format, the nonnative format on disk is
converted to native format in memory. If a converted nonnative value
is outside the range of the native data type, a run-time message
appears.
There are other ways to specify numeric format for unformatted
files: you can specify an OpenVMS logical name, the command line
qualifier /CONVERT, or OPTIONS/CONVERT. The following shows the
order of precedence:
Method Used | Precedence |
---|---|
An OpenVMS logical name | Highest |
OPEN (CONVERT=) | . |
OPTIONS/CONVERT | . |
The /CONVERT qualifier | Lowest |
The /CONVERT qualifier and OPTIONS/CONVERT affect all unit numbers
used by the program, while logical names and OPEN (CONVERT=) affect
specific unit numbers.
The following example shows how to code the OPEN statement to read
unformatted CRAY numeric data from unit 15, which might be processed
and possibly written in native little endian format to unit 20:
OPEN (CONVERT='CRAY', FILE='graph3.dat', FORM='UNFORMATTED',
1 UNIT=15)
.
.
.
OPEN (FILE='graph3_native.dat', FORM='UNFORMATTED', UNIT=20)