Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

CLOSEFILE Statement

closes an input or output file

CLOSEFILE files;

where files can be names (for defined filenames), literals, or expressions in parentheses (for filepaths).

The CLOSEFILE statement is used to close files opened by the INFILE or FILE statement. The file specification should be the same as when the file was opened. File specifications are either a name (for a defined filename), a literal, or an expression in parentheses (for a filepath). To find out what files are open, use the statement SHOW files. For further information, consult Chapter 7, "File Access."

See also the description of the SAVE statement. IML automatically closes all files when a QUIT statement is executed.

Examples of the CLOSEFILE statement are shown below.

   filename in1 'mylib.mydata';
   closefile in1;
or
   closefile 'mylib.mydata';
or
   in='mylib/mydata';
   closefile(in);

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.