Previous Page | Next Page

Using SAS Files

Holding a File in Memory: The SASFILE Statement

You can use the SASFILE statement to open a SAS data set. SAS attempts to allocate enough buffers to hold the entire data set in memory. If enough memory is available, then the entire data set is kept in memory until the data set is closed. If enough memory is not available, then SAS allocates as many buffers as it can. If your file is very large or if SAS is already using a large amount of memory, then using the SASFILE statement will not help.

When the SASFILE statement executes the first time, SAS opens the file. Subsequent DATA and PROC steps use the file without having to open it again because the file remains in memory. The file remains open until a second SASFILE statement closes it, or until the program or session ends. For more information, see SASFILE in SAS Language Reference: Dictionary.

Previous Page | Next Page | Top of Page