RESULTS= LIBNAME Statement Option

Determines where to store query results.

Valid in: SAS/ACCESS LIBNAME statement
Category: Data Set Control
Default: MEMORY
Interaction: See the CONNECTION= LIBNAME option for an interaction with the RESULTS= option.
Data source: MySQL
Example: Send results to a temporary disk file:
libname spooled mysql … results=disk;

Table of Contents

Syntax

RESULTS=MEMORY | SERVER | DISK

Syntax Description

MEMORY

stores query results in client memory.

SERVER

stores query results on the server.

DISK (no longer supported)

stores query results in a temporary disk file on the client computer.

Note: As of SAS 9.4M9, RESULTS=DISK is deprecated. A note is printed in the SAS log, and the RESULTS= value is changed automatically, depending on the value of the CONNECTION= LIBNAME statement option. If CONNECTION=UNIQUE, then RESULTS=SERVER is used. For any other CONNECTION= option value, RESULTS=MEMORY is used.

Details

When you set RESULTS=MEMORY, all result sets are stored in the memory of the client. If there is not enough memory to store the data, the client writes an error to the SAS log. Using RESULTS=MEMORY also allows multiple Read cursors to be opened on the same data source connection at the same time. When you also set CONNECTION=SHAREDREAD, the number of connections to the data source server is minimized.

When you set RESULTS=SERVER, records are stored on the server, and SAS retrieves them on demand. This value offers better performance than RESULTS=MEMORY. Note that unlike RESULTS=MEMORY, with RESULTS=SERVER, multiple Read cursors cannot be opened on the same connection at the same time. Therefore, if you set RESULTS=SERVER and you call a procedure or DATA step that attempts to open multiple Read cursors on the same connection, you might see one of these errors in the SAS log:

ERROR: Commands out of sync; you can't run this command now.
ERROR: Cursor fetch error: Row retrieval was canceled ...
Last updated: February 3, 2026