BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mishka1
Fluorite | Level 6

I'm trying to get data from an Access 2007 database. The field is text and can be 2000 characters long.

SAS is truncating the field to 1024 chars.

What is the correct way of importing this table so that the field length is preserved?

What I'm doing now is creating a libname using odbc to connect to the Access db.

When I "View Columns" in the table in Explorer window in SAS for the Access library, it shows the length of the field as 1024.

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Use the Access Engine as in :

libname ac Access "myDatabase.accdb" DBMAX_TEXT=2048;

from SAS doc:

DBMAX_TEXT= integer between 1 and 32,767

specifies the maximum length for a character string. Character strings longer than 32,767 are truncated. This option only applies when you are reading, appending, and updating character data in a Microsoft Access database or Microsoft Excel workbook from SAS.

Default:1,024

PG

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

Use the Access Engine as in :

libname ac Access "myDatabase.accdb" DBMAX_TEXT=2048;

from SAS doc:

DBMAX_TEXT= integer between 1 and 32,767

specifies the maximum length for a character string. Character strings longer than 32,767 are truncated. This option only applies when you are reading, appending, and updating character data in a Microsoft Access database or Microsoft Excel workbook from SAS.

Default:1,024

PG

PG
Mishka1
Fluorite | Level 6

Excellent. Thank you.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1871 views
  • 0 likes
  • 2 in conversation