The OPTMODEL Procedure

CLOSEFILE Statement

CLOSEFILE file-specification(s);

The CLOSEFILE statement closes files that were opened by the FILE statement. Each file is specified by a logical name, a physical filename in quotation marks, or an expression enclosed in parentheses that evaluates to a physical filename. See the section "FILE Statement" for more information about file specifications.

The following example shows how the CLOSEFILE statement is used with a logical filename:

  
    filename greet 'hello.txt'; 
    proc optmodel; 
       file greet; 
       put 'Hi!'; 
       closefile greet;
 

Generally you must close a file with a CLOSEFILE statement before external programs can access the file. However, any open files are automatically closed when PROC OPTMODEL terminates.

Previous Page | Next Page | Top of Page