space
Previous Page | Next Page

The SERVER Procedure

Syntax for the ALLOCATE SASFILE Command


Specifies SAS data sets to open and keep in memory for the duration of a SAS/SHARE server session.
Valid In: PROC step
Tip: Keeping SAS data sets open can improve server performance by reducing the overhead that normally occurs when users open and close the data sets during application processing. A file remains open until the program or SAS session ends.


Syntax

ALLOCATE SASFILE SAS-data-set1 <(data-set-options) >
<SAS-data-set2 <(data-set-options)> ...
SAS-data-set8 <(data-set-options)>>;

Arguments

SAS-data-set

contains descriptor information and its related data values organized as a table of observations and variables that can be processed by SAS.

data-set-options

specify actions that apply only to the SAS data set with which they appear. For complete details about data set options, see SAS Language Reference: Dictionary.

Note:   You must define all librefs before using them in an ALLOCATE SASFILE command.  [cautionend]


ALLOCATE SASFILE Command Considerations

Consider the following when using the ALLOCATE SASFILE command with the PROC SERVER statement:


Comparison: ALLOCATE SASFILE Command and SASFILE Statement

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 Levels of File Buffering) for each data set.

Levels of File Buffering
Level of File Buffering Memory Consumed Condition for Using
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 in SAS Language Reference: Dictionary: the BUFNO= system option, the BUFNO= data set option, and the SASFILE statement.


Example

In the following example, server SHARE1 is started and eight data sets are specified to be stored in memory for client access. The number of buffers that are used is determined by the default value of the BUFNO= system option.

proc server id=share1;
allocate sasfile sas-dataset1 sas-dataset2 ... sas-dataset8;
run;

space
Previous Page | Next Page | Top of Page