SCANSTRINGCOLUMNS= Data Set Option

Specifies whether to determine the maximum length of VARCHAR columns in a database table or query.

Valid in: DATA and PROC steps (when accessing DBMS data using SAS/ACCESS software)
Category: Data Set Control
Alias: SCAN_STRING_COLUMNS=, SCAN_STRINGS=, SCANSTRINGS=
Default: LIBNAME option value
Data source: Google BigQueryMicrosoft SQL Server, ODBC, Snowflake
Notes: Support for this option was added in the April 2021 updates for SAS/ACCESS on SAS 9.4M7 and SAS Viya 3.5.
Support for Microsoft SQL Server and ODBC was added in SAS 9.4M9.
See: SCANSTRINGCOLUMNS= LIBNAME option

Table of Contents

Syntax

SCANSTRINGCOLUMNS=YES | NO

Required Arguments

YES

specifies to scan all VARCHAR columns in a database table to determine the actual maximum length of the columns before loading data. If the VARCHAR columns have been created with the maximum VARCHAR precision, then using this option can reduce the size of the resulting table and accelerate the loading process.

NO

specifies that VARCHAR columns are not scanned before loading data.

Details

This option can be specified for any table, but the best performance improvement occurs for larger tables. A table is considered to be large if it contains a large number of rows, a large number of VARCHAR columns, or both.

For more information about the columns that are scanned for different data sources, see Overview of SCANSTRINGCOLUMNS= Behavior.

ODBC: For information about ensuring that queries use this option, see ODBC: Use Implicit PROC SQL Queries for SCANSTRINGCOLUMNS= .

Last updated: February 3, 2026