Problem Note 69669: Character variables are assigned a length of 32,767 characters with SAS/ACCESS® Interface to Snowflake
When a character column in Snowflake has an undefined length, SAS assigns the column a length of 32,767 characters. When you create a SAS data set, the variable length is based on the length that is returned from the Snowflake ODBC driver. By design, Snowflake uses the length of the actual character string contained in the column. However, that length is not scanned or returned when you query the column through the ODBC driver. As a result, the column returns the maximum allowed length for a column in Snowflake, which is then truncated to the maximum SAS length for a character variable.
Available Workarounds:
To circumvent this issue, complete any of the following workarounds:
- Ensure that the database column has a defined length. This can be accomplished if you define the length directly against the column or with a view of the data where the lengths are defined.
- If a defined length is not required, the Snowflake ODBC driver can set the maximum or default size for VARCHAR columns with the addition of the default_varchar_size driver option. For details about the driver option, see the "Additional Connection Parameters" section of the Snowflake documentation.
- Use the CAST function in Snowflake to define the length of individual columns as needed. However, this option is available only when you use PROC SQL pass-through from SAS.
Click the Hot Fix tab in this note to access the hot fix for this issue.
After you apply the hot fix, you can use the LIBNAME option, SCANSTRINGCOLUMNS=YES.
Operating System and Release Information
SAS System | SAS/ACCESS Interface to Snowflake | Microsoft® Windows® for x64 | 9.42 | 9.43 | 9.4 TS1M7 | 9.4 TS1M8 |
Linux for x64 | 9.42 | 9.43 | 9.4 TS1M7 | 9.4 TS1M8 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Problem Note |
Priority: | medium |
Date Modified: | 2022-12-22 11:18:53 |
Date Created: | 2022-11-09 14:22:09 |