PRB: Opening Scratch File with Units 0, 5, or 6 Causes F6202

Last reviewed: December 11, 1995
Article ID: Q87982
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 4.0, 4.01, 4.1, 5.0, and 5.1
  • Microsoft FORTRAN for OS/2, versions 4.1, 5.0, and 5.1
  • Microsoft FORTRAN PowerStation for MS-DOS, versions 1.0 and 1.0a
  • Microsoft FORTRAN PowerStation 32 for Windows NT, version 1.0 and 4.0

SYMPTOMS

Programs that open an unformatted scratch file with the unit number 0, 5, or 6 may cause the following error:

   run-time error F6202: OPEN(CON)
   -terminal I/O not consistent with OPEN options

CAUSE

The unit numbers 0, 5, and 6 for the open statement have been pre-assigned to do formatted I/0 on keyboard and screen. Opening unformatted scratch files with these unit numbers causes the runtime to attempt to open the keyboard or screen for unformatted I/O, which generates the above error. This is expected and correct behavior.

RESOLUTION

To avoid this error, open the scratch file with any number other than 0, 5, and 6.

MORE INFORMATION

Sample Code #1

The following code generates the error:

      open(6, form='unformatted')
      end

Sample Code #2

The following code illustrates a correct usage of the open statement for creating an unformatted scratch file:

      open(3, form='unformatted')
      end


Additional reference words: 4.00 4.10 5.00 5.10 1.00
KBCategory: kbprg kberrmsg kbcode kbprb
KBSubcategory: FORTLngIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 11, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.