# OPEN Statement CONVERT Method

Use this method to specify a nonnative numeric format for each specified unit number. This method requires an explicit file `OPEN` statement to specify the numeric format of the file for that unit number.

This method takes precedence over the `OPTIONS` statement and the compiler option `CONVERT[:] keyword` method, but has a lower precedence than the environment variable methods.

For example, the following source code shows how the `OPEN` statement would be coded to read unformatted VAXD numeric data from unit 15, which might be processed and possibly written in native little endian format to unit 20 (the absence of the `CONVERT` keyword or environment variables `FORT_CONVERT20`, `FORT_CONVERT.dat`, or `FORT_CONVERT_dat` indicates native little endian data for unit 20):

     OPEN (CONVERT='VAXD', FILE='graph3.dat', FORM='UNFORMATTED', UNIT=15)
      ...
     OPEN (FILE='graph3_t.dat', FORM='UNFORMATTED', UNIT=20)

A hard-coded `OPEN` statement `CONVERT` keyword value cannot be changed after compile time. However, to allow selection of a particular format at run time, equate the `CONVERT` keyword to a variable and provide the user with a menu that allows selection of the appropriate format (menu choice sets the variable) before the `OPEN` occurs.

You can also select a particular format at run time for a unit number by using one of the environment variable methods (Environment Variable FORT_CONVERTn Method, Environment Variable FORT_CONVERT.ext or FORT_CONVERT_ext Method, or Environment Variable F_UFMTENDIAN Method), which take precedence over the `OPEN` statement `CONVERT` keyword method.

Parent topic: Specifying the Data Format

## See Also

OPEN
Environment Variable FORT_CONVERTn Method
Environment Variable FORT_CONVERT.ext or FORT_CONVERT_ext Method
Environment Variable F_UFMTENDIAN Method