The view buffer is a
segment of memory that is allocated to hold output observations that
are generated for a view. The size of the buffer determines how much
data can be held in memory at one time.
The view buffer is shared
between the request that opens the view (for example, a SAS procedure)
and the view itself. Two computer tasks coordinate between requesting
data and generating and returning the data as follows:
-
When a request task (such as a
PRINT procedure) requests data, task switching occurs from the request
task to the view task in order to execute the view and generate the
observations. The view fills the view buffer with as many observations
as possible.
-
When the view buffer is full, task
switching occurs from the view task back to the request task in order
to return the requested data. The observations are cleared from the
view buffer.
The size of the view
buffer and the size of an observation determine how many observations
can be held in the buffer. To determine the observation length, use
PROC CONTENTS for the view. The number of observations then determines
how many times the computer must switch between the request task and
the view task. The larger the view buffer is, the less task switching
is needed to process a view, which can speed up execution time.
To improve efficiency,
first determine how many observations fit into the default buffer
size, then set the view buffer so that it can hold more generated
observations.
If OBSBUF= is set for
a view, SAS uses the value of OBSBUF= and not the value of VBUFSIZE=
to determine the size of the view buffer.
The view buffer is released
when the view completes execution.