The ALLOCATE SASFILE
command is similar and complementary to the SASFILE statement in Base
SAS. The SASFILE statement can be used in a server session as well
as in a single-user session. Both statements used in a server session
achieve performance gains by providing in-memory processing using
buffers.
A buffer is a reserved
area of memory that holds a segment of data while it is processed.
The number of allocated buffers determines how much data can be held
in memory at one time.
The ALLOCATE SASFILE
command offers limited buffering. The SASFILE statement in Base SAS
provides maximum buffering, and therefore, the best performance.
You can specify any of the following four levels of file buffering
(shown in the following table) for each data set.
Levels of File Buffering
|
|
|
Neither the ALLOCATE
SASFILE command nor the SASFILE statement is used.
|
The least amount of
memory is consumed. Each client that accesses a file duplicates the
same overhead that is required for a file open.
|
File access is limited
and memory is constrained.
|
Use the ALLOCATE SASFILE
command, and accept the default number of buffers that are pre-allocated.
|
The SAS/SHARE server opens the file and keeps
it open for all client access, which eliminates the duplicate overhead
that is required for a file open.
|
File access is frequent
and memory is constrained.
|
Use the ALLOCATE SASFILE
command, and use the BUFNO= data set option to specify the number
of buffers to pre-allocate.
|
Specify buffers according
to available memory and the usage pattern of the file.
|
The file being accessed
is large, but only certain pages of the data are accessed frequently.
|
Use the SASFILE statement
to read the entire data set into memory.
|
The entire file resides
in memory.
|
File access is frequent
and there is sufficient memory for reading in the entire file.
|
For details about the
SASFILE statement in Base SAS, see the following topics:
.