Top: f77 Up: 13 - Statements
Previous: 13,44 - NAMELIST Next: 13,45,1 - ACCESS


Section 13,45: OPEN

 Opens an existing file or creates a new file.  If you do not
 explicitly open a file before accessing it, the file is created
 (for write operations) or opened with default attributes.

    OPEN (par[,par]...)

    par  Is a keyword specification in one of the 
         following forms:

         keywd
         keywd=value

         keywd  Is a keyword.  (See the subtopic headings
                listed at the end of this Help topic.)
         value  Is a keyword value. (Some keywords do not
                have keyword values.)

 If an OPEN statement is executed for a unit that is already open,
 and the file pathname (or specification) is different from that of
 the current open file, the previously opened file is closed and the
 new file is opened.  If the file pathname (or specification) is the
 same for both files, the new value of the BLANK= specifier is in
 effect, but the position of the file is unaffected.

 Keyword specifications can appear in any order.  In most cases,
 they are optional.  Default values apply in their absence.  If the
 logical unit specifier is the first parameter in the list, the UNIT
 keyword is optional.

 You can specify character values at run time by substituting a
 general character expression for a keyword value in the OPEN
 statement.  The character value can contain trailing spaces but not
 leading or embedded spaces; for example:

    CHARACTER*6 FINAL /' '/
        .
        .
        .
    IF (exp) FINAL = 'DELETE'
    OPEN (UNIT=1, STATUS='NEW', DISP=FINAL)

 NOTE:  Keyword values that are numeric expressions can be any
 integer or real expression.  The value of the expression is
 converted to integer data type before it is used in the OPEN
 statement.

Sub-Topics

  1. ACCESS
  2. ASSOCIATEVARIABLE
  3. BLANK
  4. BLOCKSIZE
  5. BUFFERCOUNT
  6. CARRIAGECONTROL
  7. CONVERT
  8. DEFAULTFILE
  9. DISPOSE
  10. ERR
  11. EXTENDSIZE
  12. FILE
  13. FORM
  14. INITIALSIZE
  15. IOSTAT
  16. KEY
  17. MAXREC
  18. NAME
  19. NOSPANBLOCKS
  20. ORGANIZATION
  21. READONLY
  22. RECL
  23. RECORDSIZE
  24. RECORDTYPE
  25. SHARED
  26. STATUS
  27. TYPE
  28. UNIT
  29. USEROPEN

Top: f77 Up: 13 - Statements
Previous: 13,44 - NAMELIST Next: 13,45,1 - ACCESS